ParseTree

TODO add interface description @uml 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
T accept(ParseTreeVisitor!U visitor)

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

getChild
ParseTree getChild(int i)

@uml @override

getParent
ParseTree getParent()

@uml @override

getText
string getText()

@uml 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.

toStringTree
string toStringTree(InterfaceRecognizer parser)

@uml 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