|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.BaseAST | +--antlr.CommonAST | +--antlr.CommonASTWithHiddenTokens | +--com.octagroup.foregej.antlr.BaseAST
The base representation of an AST in the FOREGEJ system.
Field Summary | |
protected DynASTFactory |
astFactory_
the AST factory that created this token |
static int |
WRAP_PREF_NO
|
static int |
WRAP_PREF_NONE
|
static int |
WRAP_PREF_OK
|
Fields inherited from class antlr.CommonASTWithHiddenTokens |
hiddenAfter, hiddenBefore |
Fields inherited from class antlr.BaseAST |
down, right |
Constructor Summary | |
BaseAST()
Constructor creates a new BaseAST object. |
|
BaseAST(antlr.collections.AST ast)
Constructor creates a new BaseAST object. |
Method Summary | |
BaseAST |
deepCopy()
Performs a deep copy of the node. |
static antlr.collections.AST |
deepCopy(antlr.collections.AST ast)
|
boolean |
equals(java.lang.Object o)
|
boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Compares two objects |
antlr.collections.AST |
getChildAST(java.lang.Class type)
DOCUMENT ME! |
java.util.List |
getChildASTs(java.lang.Class type)
Returns all the child asts that match the supplied type. |
java.util.List |
getChildASTsExcluding(java.lang.Class[] excluding)
Returns all the child asts that do not match the supplied classes. |
antlr.collections.AST |
getParentAst()
Returns the parent AST. |
int |
getWrappingPreference()
As we invoke the NodeWriter.write we store how the node
prefers to handle wrapping. |
void |
insertAfter(java.lang.Class afterType,
antlr.collections.AST newAst)
Helper method that inserts an ast after the last occurence of the supplied type. |
void |
insertFirst(antlr.collections.AST newAst)
Helper method that replaces a child or ast with a new ast. |
boolean |
replaceAST(antlr.collections.AST oldAst,
antlr.collections.AST newAst)
Helper method that replaces a child or ast with a new ast. |
void |
setASTFactory(DynASTFactory factory)
Sets the factory used to create this AST. |
void |
setFirstChild(antlr.collections.AST child)
As we set the first child we update the parent of the child ast to this ast. |
void |
setFirstChildForced(antlr.collections.AST child)
As we set the first child we update the parent of the child ast to this ast. |
void |
setHiddenAfter(BaseToken hiddenAfter)
Sets the token hidden after this ast. |
void |
setHiddenBefore(BaseToken hiddenBefore)
Sets the token hidden before this ast. |
void |
setNextSibling(antlr.collections.AST sib)
As we set the next sibling we update the parent ast to the same ast as this node. |
void |
setNextSiblingForced(antlr.collections.AST sib)
As we set the next sibling we update the parent ast to the same ast as this node. |
void |
setParentAst(antlr.collections.AST parent)
Sets the parent AST. |
void |
setType(int type)
Sets the type of this ast. |
java.lang.String |
toString()
|
java.lang.String |
toString(boolean includeComments)
|
void |
write(NodeWriter nw)
DOCUMENT ME! |
Methods inherited from class antlr.CommonASTWithHiddenTokens |
getHiddenAfter, getHiddenBefore, initialize |
Methods inherited from class antlr.CommonAST |
getText, getType, initialize, initialize, setText |
Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, removeChildren, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int WRAP_PREF_NONE
public static int WRAP_PREF_NO
public static int WRAP_PREF_OK
protected DynASTFactory astFactory_
Constructor Detail |
public BaseAST()
public BaseAST(antlr.collections.AST ast)
ast
- DOCUMENT ME!Method Detail |
public int getWrappingPreference()
NodeWriter.write
we store how the node
prefers to handle wrapping.public antlr.collections.AST getChildAST(java.lang.Class type)
type
- DOCUMENT ME!public java.util.List getChildASTs(java.lang.Class type)
type
- the type to look for.public java.util.List getChildASTsExcluding(java.lang.Class[] excluding)
excluding
- the classes to exclude.public void insertAfter(java.lang.Class afterType, antlr.collections.AST newAst)
afterType
- DOCUMENT ME!newAst
- the new astjava.lang.RuntimeException
- DOCUMENT ME!public void insertFirst(antlr.collections.AST newAst)
newAst
- the new astpublic boolean replaceAST(antlr.collections.AST oldAst, antlr.collections.AST newAst)
oldAst
- the ast to replacenewAst
- the new astpublic void write(NodeWriter nw)
nw
- DOCUMENT ME!java.lang.RuntimeException
- DOCUMENT ME!public boolean equals(java.lang.Object o1, java.lang.Object o2)
o1
- o2
- public BaseAST deepCopy()
public static antlr.collections.AST deepCopy(antlr.collections.AST ast)
ast
- public java.lang.String toString(boolean includeComments)
includeComments
- public java.lang.String toString()
toString
in class antlr.BaseAST
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- public void setHiddenBefore(BaseToken hiddenBefore)
hiddenBefore
- public void setHiddenAfter(BaseToken hiddenAfter)
hiddenAfter
- public void setASTFactory(DynASTFactory factory)
This method is invoked from the AST factory when the token is created.
The factory is used to signal that types have been changed.
factory
- the factory that created the ASTpublic void setType(int type)
It also signals to the AST factory that we have modified the type so that the next call to the DynASTFactory scans the tree to replace the created AST with the new type.
setType
in class antlr.CommonAST
type
- public void setParentAst(antlr.collections.AST parent)
parent
- the parent ASTpublic antlr.collections.AST getParentAst()
public void setFirstChild(antlr.collections.AST child)
We need to update all the siblings of the first child as well.
setFirstChild
in class antlr.BaseAST
child
- public void setFirstChildForced(antlr.collections.AST child)
We need to update all the siblings of the first child as well.
This method does not check that the new child has a parent specified.
child
- public void setNextSibling(antlr.collections.AST sib)
setNextSibling
in class antlr.BaseAST
sib
- public void setNextSiblingForced(antlr.collections.AST sib)
This method does not check that the supplied sibling has a parent AST specified.
sib
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |