Package antlr.collections
Interface AST
- All Known Implementing Classes:
ASTNULLType,BaseAST,CommonAST,CommonASTWithHiddenTokens,ParseTree,ParseTreeRule,ParseTreeToken
public interface AST
Minimal AST node interface used by ANTLR AST generation
and tree-walker.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a (rightmost) child to this nodebooleanbooleanequalsList(AST t) booleanbooleanequalsTree(AST t) booleanfindAllPartial(AST subtree) intGet the first child of this node; null if no childrenintgetLine()Get the next sibling in line after this oneintGet number of children of this node; if leaf, returns 0getText()Get the token text for this nodeintgetType()Get the token type for this nodevoidinitialize(int t, String txt) voidinitialize(AST t) voidinitialize(Token t) voidsetFirstChild(AST c) Set the first child of a node.voidSet the next sibling after this one.voidSet the token text for this nodevoidsetType(int ttype) Set the token type for this nodetoString()
-
Method Details
-
addChild
Add a (rightmost) child to this node -
equals
-
equalsList
-
equalsListPartial
-
equalsTree
-
equalsTreePartial
-
findAll
-
findAllPartial
-
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
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
-
initialize
-
initialize
-
setFirstChild
Set the first child of a node. -
setNextSibling
Set the next sibling after this one. -
setText
Set the token text for this node -
setType
void setType(int ttype) Set the token type for this node -
toString
String toString() -
toStringList
String toStringList() -
toStringTree
String toStringTree()
-