| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | accept(ParseTreeVisitor<? extends T> visitor)
Implements org. ParseTreeVisitor needs a double dispatch method.
|
| public ParseTree | getChild(int i)
Implements org. ith value indexed from 0.
|
| public int | getChildCount()
Implements org. |
| public ParseTree | |
| public Token | getPayload()
Implements org. |
| public Interval | getSourceInterval()
Implements org. Interval indicating the index in the
TokenStream of the first and last token associated with this
subtree.
|
| public Token | |
| public String | getText()
Implements org. |
| public void | setParent(RuleContext parent)
Implements org. |
| public String | |
| public String | toStringTree(Parser parser)
Implements org. |
| public String | toStringTree()
Implements org. (root child1 ..
|
| parent | back to summary |
|---|---|
| public ParseTree parent | |
| symbol | back to summary |
|---|---|
| public Token symbol | |
| TerminalNodeImpl | back to summary |
|---|---|
| public TerminalNodeImpl(Token symbol) | |
| accept | back to summary |
|---|---|
| public <T> T accept(ParseTreeVisitor<? extends T> visitor) Implements org. Doc from org. The
| |
| getChild | back to summary |
|---|---|
| public ParseTree getChild(int i) Implements org. Doc from org. If there are children, get the
| |
| getChildCount | back to summary |
|---|---|
| public int getChildCount() Implements org. Doc from org. How many children are there? If there is none, then this node represents a leaf node.
| |
| getParent | back to summary |
|---|---|
| public ParseTree getParent() Implements org. Doc from org. The parent of this node. If the return value is null, then this node is the root of the tree.
| |
| getPayload | back to summary |
|---|---|
| public Token getPayload() Implements org. Doc from org. This method returns whatever object represents the data at this node. For
example, for parse trees, the payload can be a
| |
| getSourceInterval | back to summary |
|---|---|
| public Interval getSourceInterval() Implements org. Doc from org. Return an An interval of i..i-1 indicates an empty interval at position i in the input stream, where 0 <= i <= the size of the input token stream. Currently, the code base can only have i=0..n-1 but in concept one could have an empty interval after EOF. If source interval is unknown, this returns As a weird special case, the source interval for rules matched after EOF is unspecified.
| |
| getSymbol | back to summary |
|---|---|
| public Token getSymbol() Implements org.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements org. Doc from org. Return the combined text of all leaf nodes. Does not get any off-channel tokens (if any) so won't return whitespace and comments if they are sent to parser on hidden channel.
| |
| setParent | back to summary |
|---|---|
| public void setParent(RuleContext parent) Implements org. Doc from org. Set the parent for this node. This is not backward compatible as it changes the interface but no one was able to create custom nodes anyway so I'm adding as it improves internal code quality. One could argue for a restructuring of the class/interface hierarchy so that setParent, addChild are moved up to Tree but that's a major change. So I'll do the minimal change, which is to add this method.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| toStringTree | back to summary |
|---|---|
| public String toStringTree(Parser parser) Implements org. Doc from org. Specialize toStringTree so that it can print out more information based upon the parser.
| |
| toStringTree | back to summary |
|---|---|
| public String toStringTree() Implements org. Doc from org. Print out a whole tree, not just a node, in LISP format
| |