|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectantlr.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 SliceAST| Method 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.ASTgetText in class antlr.BaseASTpublic final int getType()
getType in interface antlr.collections.ASTgetType in class antlr.BaseAST
public final void initialize(int t,
String txt)
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTt - Node typetxt - Node tagpublic final void initialize(antlr.collections.AST t)
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTt - Another node.public final void initialize(antlr.Token tok)
initialize in interface antlr.collections.ASTinitialize in class antlr.BaseASTtok - A token.public final void setText(String text_)
setText in interface antlr.collections.ASTsetText in class antlr.BaseASTtext_ - The text to use.public final void setType(int ttype_)
setType in interface antlr.collections.ASTsetType in class antlr.BaseASTttype_ - Type to usepublic final SliceAST getLeftmostChild()
public final String prettyPrint()
public final boolean equalsList(antlr.collections.AST t)
equalsList in interface antlr.collections.ASTequalsList in class antlr.BaseASTpublic final boolean equalsTree(antlr.collections.AST t)
equalsTree in interface antlr.collections.ASTequalsTree in class antlr.BaseASTpublic final boolean equals(antlr.collections.AST t)
equals in interface antlr.collections.ASTequals in class antlr.BaseASTpublic final antlr.collections.AST getFirstChild()
getFirstChild in interface antlr.collections.ASTgetFirstChild in class antlr.BaseASTpublic final antlr.collections.AST getNextSibling()
getNextSibling in interface antlr.collections.ASTgetNextSibling in class antlr.BaseASTpublic 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 | |||||||||