Package org.antlr.runtime.tree
Class ParseTree
java.lang.Object
org.antlr.runtime.tree.BaseTree
org.antlr.runtime.tree.ParseTree
- All Implemented Interfaces:
Tree
A record of the rules used to match a token sequence. The tokens
end up as the leaves of this tree and rule nodes are the interior nodes.
This really adds no functionality, it is just an alias for CommonTree
that is more meaningful (specific) and holds a String to display for a node.
-
Field Summary
FieldsFields inherited from interface org.antlr.runtime.tree.Tree
INVALID_NODE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dupNode()
getText()
int
What is the smallest token index (indexing from 0) for this node and its children?int
What is the largest token index (indexing from 0) for this node and its children?int
getType()
Return a token type; needed for tree parsingvoid
setTokenStartIndex
(int index) void
setTokenStopIndex
(int index) Print out the leaves of this tree, which means printing original input back out.toString()
Override to say how a node (not a tree) should look as textEmit a token and all hidden nodes before.Methods inherited from class org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, freshenParentAndChildIndexesDeeply, freshenParentAndChildIndexesDeeply, getAncestor, getAncestors, getCharPositionInLine, getChild, getChildCount, getChildIndex, getChildren, getFirstChildWithType, getLine, getParent, hasAncestor, insertChild, isNil, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, setChildIndex, setParent, toStringTree
-
Field Details
-
payload
-
-
Constructor Details
-
ParseTree
-
-
Method Details
-
dupNode
-
getType
public int getType()Description copied from interface:Tree
Return a token type; needed for tree parsing -
getText
-
getTokenStartIndex
public int getTokenStartIndex()Description copied from interface:Tree
What is the smallest token index (indexing from 0) for this node and its children? -
setTokenStartIndex
public void setTokenStartIndex(int index) -
getTokenStopIndex
public int getTokenStopIndex()Description copied from interface:Tree
What is the largest token index (indexing from 0) for this node and its children? -
setTokenStopIndex
public void setTokenStopIndex(int index) -
toString
Description copied from class:BaseTree
Override to say how a node (not a tree) should look as text -
toStringWithHiddenTokens
Emit a token and all hidden nodes before. EOF node holds all hidden tokens after last real token. -
toInputString
Print out the leaves of this tree, which means printing original input back out. -
_toStringLeaves
-