public class TerminalNodeImpl extends Object implements TerminalNode
| Constructor and Description |
|---|
TerminalNodeImpl(Token symbol) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(ParseTreeVisitor<? extends T> visitor)
The ParseTreeVisitor needs a double dispatch method
|
ParseTree |
getChild(int i)
If there are children, get the ith value indexed from 0.
|
int |
getChildCount()
How many children are there? If there is none, then this
node represents a leaf node.
|
ParseTree |
getParent()
The parent of this node.
|
Token |
getPayload()
This method returns whatever object represents the data at this note.
|
Interval |
getSourceInterval()
Return an interval indicating the index in the TokenStream of
the first and last token associated with this subtree.
|
Token |
getSymbol() |
String |
getText()
Return the combined text of all leaf nodes.
|
String |
toString() |
String |
toStringTree()
Print out a whole tree, not just a node, in LISP format
(root child1 ..
|
String |
toStringTree(Parser parser)
Specialize toStringTree so that it can print out more information
based upon the parser.
|
public TerminalNodeImpl(Token symbol)
public ParseTree getChild(int i)
Treepublic Token getSymbol()
getSymbol in interface TerminalNodepublic ParseTree getParent()
Treepublic Token getPayload()
TreegetPayload in interface Treepublic Interval getSourceInterval()
SyntaxTreeInterval.INVALID.getSourceInterval in interface SyntaxTreepublic int getChildCount()
TreegetChildCount in interface Treepublic <T> T accept(ParseTreeVisitor<? extends T> visitor)
ParseTreepublic String getText()
ParseTreepublic String toStringTree(Parser parser)
ParseTreetoStringTree in interface ParseTreepublic String toStringTree()
TreetoStringTree in interface TreeCopyright © 2012. All Rights Reserved.