|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.BaseAST | +--antlr.CommonAST | +--antlraux.util.LexInfoAST | +--antlraux.context.asts.ScopeAST
This AST implementation is very useful when modelling ASTs that store a declaration that has a scope, like a class or method.
ScopeAST
is capable of showing some additional information
in toString()
if LexInfoAST.verboseStringConversion
is
set to true using setVerboseStringConversion(boolean)
:
ScopeAST ast = new ScopeAST(Warning:
TypeAST
, ExpressionAST
and ScopeAST
copy first child and sibling with their only constructor. See their
constructor's comments for details.
Field Summary | |
protected Scope |
scope
|
Fields inherited from class antlraux.util.LexInfoAST |
verboseStringConversion |
Fields inherited from class antlr.BaseAST |
down, right |
Fields inherited from interface antlraux.util.LexInfo |
DEFAULT_COLUMN, DEFAULT_FILENAME, DEFAULT_LINE |
Constructor Summary | |
ScopeAST()
|
|
ScopeAST(antlr.collections.AST ast,
Scope scope)
This constructors calls initialize(AST) , so it
copies next sibling and first child. |
Method Summary | |
Scope |
getScope()
|
void |
initialize(antlr.collections.AST ast)
Warning: this implementation of initialize copies ast's first child and next sibling. |
void |
setScope(Scope s)
|
static void |
setVerboseStringConversion(boolean b)
If set to true, this adds some additional information to the string generated by toString()
(shows the AST's scope's name) |
java.lang.String |
toString()
Returns a String representing the information in the root of the node. |
Methods inherited from class antlraux.util.LexInfoAST |
addChildLeft, addChildLeftWithSiblings, addSibling, copyLexInfo, getColumn, getFilename, getLastChild, getLastSibling, getLexInfoString, getLine, getPrevChild, initialize, replaceChild, replaceChildWithSiblings, setColumn, setFilename, setLine, tabulate, toStringList, toStringList, toStringTree |
Methods inherited from class antlr.CommonAST |
getText, getType, initialize, setText, setType |
Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Scope scope
Constructor Detail |
public ScopeAST()
public ScopeAST(antlr.collections.AST ast, Scope scope)
initialize(AST)
, so it
copies next sibling and first child.
Method Detail |
public void setScope(Scope s)
public Scope getScope()
public static void setVerboseStringConversion(boolean b)
toString()
(shows the AST's scope's name)
public java.lang.String toString()
LexInfoAST
LexInfoAST.setVerboseStringConversion(boolean)
has been set to true, it adds the lex information of
the AST (using LexInfoAST.getLexInfoString()
)
toString
in interface antlr.collections.AST
toString
in class LexInfoAST
public void initialize(antlr.collections.AST ast)
initialize
in interface antlr.collections.AST
initialize
in class LexInfoAST
ast
- The AST whose information is to be copied
|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |