ReadonlychildrenThe parent of this node. If the return value is null, then this node is the root of the tree.
Static ReadonlyemptyThe ParseTreeVisitor needs a double dispatch method.
Copy a context
For rule associated with this parse tree internal node, return the outer alternative number used to match the input. Default implementation does not compute nor store this alt num. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass. to set it.
This method returns whatever object represents the data at this node. For example, for parse trees, the payload can be a Token representing a leaf node or a RuleContext object representing a rule invocation. For abstract syntax trees (ASTs), this is a Token object.
Return an Interval indicating the index in the 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.
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 Interval.INVALID.
As a weird special case, the source interval for rules matched after EOF is unspecified.
Set the outer alternative number for this context node. Default implementation does nothing to avoid backing field overhead for trees that don't need it. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass.
What state invoked the rule associated with this context? The "return address" is the followState of invokingState If parent is null, this should be -1 this context object represents the start rule.