|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object antlr.BaseAST net.obsearch.example.SliceAST
public final class SliceAST
This class provides extra functionality required by tree edit distance algorithms and the like.
Field Summary | |
---|---|
int |
decendants
Number of children this node has. |
String |
text
The text of this node. |
Fields inherited from class antlr.BaseAST |
---|
down, right |
Constructor Summary | |
---|---|
SliceAST()
Default constructor. |
|
SliceAST(int t,
String txt)
Initialize the node. |
|
SliceAST(SliceAST t)
Clone the node with this constructor. |
|
SliceAST(antlr.Token tok)
Initialize the node from a token. |
Method Summary | |
---|---|
List<SliceAST> |
depthFirst()
|
protected void |
depthFirstAux(LinkedList<SliceAST> res)
Auxiliary function for depthFirst() . |
boolean |
equals(antlr.collections.AST t)
|
boolean |
equalsList(antlr.collections.AST t)
Is t an exact structural and equals() match of this tree. |
boolean |
equalsTree(antlr.collections.AST t)
|
int |
getDescendants()
Returns the number of decendants of this node. |
antlr.collections.AST |
getFirstChild()
Get the first child of this node; null if not children |
SliceAST |
getLeftmostChild()
Get the leftmost child of this node. |
antlr.collections.AST |
getNextSibling()
Get the next sibling in line after this one |
int |
getSize()
|
String |
getText()
Get the token text for this node. |
int |
getType()
Get the token type for this node. |
void |
initialize(antlr.collections.AST t)
Initialize the node from another node. |
void |
initialize(int t,
String txt)
Initialize the node. |
void |
initialize(antlr.Token tok)
Initialize from the given token. |
String |
prettyPrint()
Print out a child-sibling tree in LISP notation. |
void |
setText(String text_)
Set the token text for this node. |
void |
setType(int ttype_)
Set the token type for this node. |
String |
toFuriaChanTree()
|
void |
updateDecendantInformation()
Updates descendants information. |
int |
updateDecendantInformationAux()
Updates descendants information. |
Methods inherited from class antlr.BaseAST |
---|
addChild, decode, encode, equalsListPartial, equalsTreePartial, findAll, findAllPartial, getColumn, getLine, 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 |
Field Detail |
---|
public int decendants
public String text
Constructor Detail |
---|
public SliceAST()
public SliceAST(int t, String txt)
t
- Node typetxt
- Node textpublic SliceAST(antlr.Token tok)
tok
- The token to use as initializer.public SliceAST(SliceAST t)
t
- Another SliceASTMethod Detail |
---|
public final int updateDecendantInformationAux()
public final void updateDecendantInformation()
public final int getDescendants()
public final int getSize()
public final String getText()
getText
in interface antlr.collections.AST
getText
in class antlr.BaseAST
public final int getType()
getType
in interface antlr.collections.AST
getType
in class antlr.BaseAST
public final void initialize(int t, String txt)
initialize
in interface antlr.collections.AST
initialize
in class antlr.BaseAST
t
- Node typetxt
- Node tagpublic final void initialize(antlr.collections.AST t)
initialize
in interface antlr.collections.AST
initialize
in class antlr.BaseAST
t
- Another node.public final void initialize(antlr.Token tok)
initialize
in interface antlr.collections.AST
initialize
in class antlr.BaseAST
tok
- A token.public final void setText(String text_)
setText
in interface antlr.collections.AST
setText
in class antlr.BaseAST
text_
- The text to use.public final void setType(int ttype_)
setType
in interface antlr.collections.AST
setType
in class antlr.BaseAST
ttype_
- Type to usepublic final SliceAST getLeftmostChild()
public final String prettyPrint()
public final boolean equalsList(antlr.collections.AST t)
equalsList
in interface antlr.collections.AST
equalsList
in class antlr.BaseAST
public final boolean equalsTree(antlr.collections.AST t)
equalsTree
in interface antlr.collections.AST
equalsTree
in class antlr.BaseAST
public final boolean equals(antlr.collections.AST t)
equals
in interface antlr.collections.AST
equals
in class antlr.BaseAST
public final antlr.collections.AST getFirstChild()
getFirstChild
in interface antlr.collections.AST
getFirstChild
in class antlr.BaseAST
public final antlr.collections.AST getNextSibling()
getNextSibling
in interface antlr.collections.AST
getNextSibling
in class antlr.BaseAST
public final List<SliceAST> depthFirst()
protected final void depthFirstAux(LinkedList<SliceAST> res)
depthFirst()
.
res
- Where the result will be stored.public final String toFuriaChanTree()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |