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)
Tree
public Token getSymbol()
getSymbol
in interface TerminalNode
public ParseTree getParent()
Tree
public Token getPayload()
Tree
getPayload
in interface Tree
public Interval getSourceInterval()
SyntaxTree
Interval.INVALID
.getSourceInterval
in interface SyntaxTree
public int getChildCount()
Tree
getChildCount
in interface Tree
public <T> T accept(ParseTreeVisitor<? extends T> visitor)
ParseTree
public String getText()
ParseTree
public String toStringTree(Parser parser)
ParseTree
toStringTree
in interface ParseTree
public String toStringTree()
Tree
toStringTree
in interface Tree
Copyright © 2012. All Rights Reserved.