ParseTree

An interface to access the tree of {@link RuleContext} objects created * during a parse that makes the data structure look like a simple parse tree. This node represents both internal nodes, rule invocations, and leaf nodes, token matches.

<p>The payload is either a {@link Token} or a {@link RuleContext} object.</p>

Members

Functions

accept
Variant accept(ParseTreeVisitor visitor)

The {@link ParseTreeVisitor} needs a double dispatch method.

getChild
ParseTree getChild(int i)

@uml @override

getParent
ParseTree getParent()

@uml @override

getText
Variant getText()
Undocumented in source.
setParent
void setParent(RuleContext parent)
Undocumented in source.
toStringTree
string toStringTree(InterfaceRecognizer parser)

Specialize toStringTree so that it can print out more information based upon the parser.

Inherited Members

From SyntaxTree

getSourceInterval
Interval getSourceInterval()

@uml Return an {@link Interval} indicating the index in the {@link TokenStream} of the first and last token associated with this subtree. If this node is a leaf, then the interval represents a single token and has interval i..i for token index i.

Meta