public abstract class BaseAST extends java.lang.Object implements AST, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected BaseAST |
down |
protected BaseAST |
right |
| Constructor and Description |
|---|
BaseAST() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(AST node)
Add a node to the end of the child list for this node
|
static java.lang.String |
decode(java.lang.String text) |
static java.lang.String |
encode(java.lang.String text) |
boolean |
equals(AST t)
Is node t equal to this in terms of token type and text?
|
boolean |
equalsList(AST t)
Is t an exact structural and equals() match of this tree.
|
boolean |
equalsListPartial(AST sub)
Is 'sub' a subtree of this list?
The siblings of the root are NOT ignored.
|
boolean |
equalsTree(AST t)
Is tree rooted at 'this' equal to 't'? The siblings
of 'this' are ignored.
|
boolean |
equalsTreePartial(AST sub)
Is 't' a subtree of the tree rooted at 'this'? The siblings
of 'this' are ignored.
|
ASTEnumeration |
findAll(AST target)
Walk the tree looking for all exact subtree matches.
|
ASTEnumeration |
findAllPartial(AST sub)
Walk the tree looking for all subtrees.
|
int |
getColumn() |
AST |
getFirstChild()
Get the first child of this node; null if not children
|
int |
getLine() |
AST |
getNextSibling()
Get the next sibling in line after this one
|
int |
getNumberOfChildren()
How many children does this node have?
|
java.lang.String |
getText()
Get the token text for this node
|
static java.lang.String[] |
getTokenNames()
Return an array of strings that maps token ID to it's text.
|
int |
getType()
Get the token type for this node
|
abstract void |
initialize(AST t) |
abstract void |
initialize(int t,
java.lang.String txt) |
abstract void |
initialize(Token t) |
void |
removeChildren()
Remove all children
|
void |
setFirstChild(AST c)
Set the first child of a node.
|
void |
setNextSibling(AST n)
Set the next sibling after this one.
|
void |
setText(java.lang.String text)
Set the token text for this node
|
void |
setType(int ttype)
Set the token type for this node
|
static void |
setVerboseStringConversion(boolean verbose,
java.lang.String[] names) |
java.lang.String |
toString() |
java.lang.String |
toStringList()
Print out a child-sibling tree in LISP notation
|
java.lang.String |
toStringTree() |
void |
xmlSerialize(java.io.Writer out) |
void |
xmlSerializeNode(java.io.Writer out) |
void |
xmlSerializeRootClose(java.io.Writer out) |
void |
xmlSerializeRootOpen(java.io.Writer out) |
public void addChild(AST node)
public int getNumberOfChildren()
getNumberOfChildren in interface ASTpublic boolean equals(AST t)
public boolean equalsList(AST t)
equalsList in interface ASTpublic boolean equalsListPartial(AST sub)
equalsListPartial in interface ASTpublic boolean equalsTree(AST t)
equalsTree in interface ASTpublic boolean equalsTreePartial(AST sub)
equalsTreePartial in interface ASTpublic ASTEnumeration findAll(AST target)
public ASTEnumeration findAllPartial(AST sub)
findAllPartial in interface ASTpublic AST getFirstChild()
getFirstChild in interface ASTpublic AST getNextSibling()
getNextSibling in interface ASTpublic java.lang.String getText()
public int getType()
public abstract void initialize(int t,
java.lang.String txt)
initialize in interface ASTpublic abstract void initialize(AST t)
initialize in interface ASTpublic abstract void initialize(Token t)
initialize in interface ASTpublic void removeChildren()
public void setFirstChild(AST c)
ASTsetFirstChild in interface ASTpublic void setNextSibling(AST n)
ASTsetNextSibling in interface ASTpublic void setText(java.lang.String text)
public void setType(int ttype)
public static void setVerboseStringConversion(boolean verbose,
java.lang.String[] names)
public static java.lang.String[] getTokenNames()
public java.lang.String toString()
public java.lang.String toStringList()
toStringList in interface ASTpublic java.lang.String toStringTree()
toStringTree in interface ASTpublic static java.lang.String decode(java.lang.String text)
public static java.lang.String encode(java.lang.String text)
public void xmlSerializeNode(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void xmlSerializeRootOpen(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void xmlSerializeRootClose(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void xmlSerialize(java.io.Writer out)
throws java.io.IOException
java.io.IOException