Package antlr.collections
Interface AST
-
- All Known Implementing Classes:
ASTNULLType,BaseAST,CommonAST,CommonASTWithHiddenTokens,ParseTree,ParseTreeRule,ParseTreeToken
public interface ASTMinimal AST node interface used by ANTLR AST generation and tree-walker.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChild(AST c)Add a (rightmost) child to this nodebooleanequals(AST t)booleanequalsList(AST t)booleanequalsListPartial(AST t)booleanequalsTree(AST t)booleanequalsTreePartial(AST t)ASTEnumerationfindAll(AST tree)ASTEnumerationfindAllPartial(AST subtree)intgetColumn()ASTgetFirstChild()Get the first child of this node; null if no childrenintgetLine()ASTgetNextSibling()Get the next sibling in line after this oneintgetNumberOfChildren()Get number of children of this node; if leaf, returns 0java.lang.StringgetText()Get the token text for this nodeintgetType()Get the token type for this nodevoidinitialize(int t, java.lang.String txt)voidinitialize(AST t)voidinitialize(Token t)voidsetFirstChild(AST c)Set the first child of a node.voidsetNextSibling(AST n)Set the next sibling after this one.voidsetText(java.lang.String text)Set the token text for this nodevoidsetType(int ttype)Set the token type for this nodejava.lang.StringtoString()java.lang.StringtoStringList()java.lang.StringtoStringTree()
-
-
-
Method Detail
-
addChild
void addChild(AST c)
Add a (rightmost) child to this node
-
equals
boolean equals(AST t)
-
equalsList
boolean equalsList(AST t)
-
equalsListPartial
boolean equalsListPartial(AST t)
-
equalsTree
boolean equalsTree(AST t)
-
equalsTreePartial
boolean equalsTreePartial(AST t)
-
findAll
ASTEnumeration findAll(AST tree)
-
findAllPartial
ASTEnumeration findAllPartial(AST subtree)
-
getFirstChild
AST getFirstChild()
Get the first child of this node; null if no children
-
getNextSibling
AST getNextSibling()
Get the next sibling in line after this one
-
getText
java.lang.String getText()
Get the token text for this node
-
getType
int getType()
Get the token type for this node
-
getLine
int getLine()
- Since:
- 2.7.3 Need for error handling
-
getColumn
int getColumn()
- Since:
- 2.7.3 Need for error handling
-
getNumberOfChildren
int getNumberOfChildren()
Get number of children of this node; if leaf, returns 0
-
initialize
void initialize(int t, java.lang.String txt)
-
initialize
void initialize(AST t)
-
initialize
void initialize(Token t)
-
setFirstChild
void setFirstChild(AST c)
Set the first child of a node.
-
setNextSibling
void setNextSibling(AST n)
Set the next sibling after this one.
-
setText
void setText(java.lang.String text)
Set the token text for this node
-
setType
void setType(int ttype)
Set the token type for this node
-
toString
java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringList
java.lang.String toStringList()
-
toStringTree
java.lang.String toStringTree()
-
-