|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--antlr.BaseAST
|
+--net.sf.imageCave.database.DataAST
AST node implementation which stores tokens explicitly. This is handy if you'd rather derive information from tokens on an as-needed basis instead of snarfing data from a token as an AST is being built. This implementation is borrowed from TokenAST Dan Bornstein, danfuzz@milk.com
The current implementation doesn't really do anything different than TokenAST (or just CommonAST, for that matter), but I wanted to have my own class for the specific type of AST generated from Image Cave *.cfg files.
BaseAST,
Serialized Form| Field Summary |
| Fields inherited from class antlr.BaseAST |
down, right |
| Constructor Summary | |
DataAST()
Construct an instance which (at least initially) is not associated with a token. |
|
DataAST(antlr.Token tok)
Construct an instance which is associated with the given token. |
|
| Method Summary | |
java.lang.String |
getText()
Get the token text for this instance. |
antlr.Token |
getToken()
Get the token associated with this instance. |
int |
getType()
Get the token type for this instance. |
void |
initialize(antlr.collections.AST ast)
Initialize this instance based on the given AST. |
void |
initialize(int type,
java.lang.String text)
Initialize this instance with the given token type and text. |
void |
initialize(antlr.Token tok)
Initialize this instance with the given token. |
void |
setText(java.lang.String text)
Set the token text for this node. |
void |
setToken(antlr.Token tok)
Set the token associated with this instance. |
void |
setType(int type)
Set the token type for this node. |
| Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DataAST()
public DataAST(antlr.Token tok)
tok - null-ok; the token to associate this instance with| Method Detail |
public java.lang.String getText()
""), not null.
getText in interface antlr.collections.ASTgetText in class antlr.BaseASTpublic int getType()
Token.INVALID_TYPE.
getType in interface antlr.collections.ASTgetType in class antlr.BaseASTpublic antlr.Token getToken()
null.
mull if there is no associated tokenpublic void setToken(antlr.Token tok)
tok - null-ok; the new token to associate with this instancepublic void initialize(antlr.Token tok)
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTtok - null-ok; the token to associate with this instance
public void initialize(int type,
java.lang.String text)
CommonToken with the given
parameters and associate this instance with it.
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTtype - the token typetext - null-ok; the token textpublic void initialize(antlr.collections.AST ast)
AST.
If the given AST is in fact an instance of
TokenAST, then this instance will be initialized
to point at the same token as the given one. If not, then this
instance will be initialized with the same token type and text
as the given one.
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTast - non-null; the AST to base this instance onpublic void setText(java.lang.String text)
Token.INVALID_TYPE and the given text.
setText in interface antlr.collections.ASTsetText in class antlr.BaseASTtext - the new token textpublic void setType(int type)
"", not null)
text string.
setType in interface antlr.collections.ASTsetType in class antlr.BaseASTtype - the new token type
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||