ParserRuleContext
| Modifier and Type | Field and Description |
|---|---|
| public int | invokingState
What state invoked the rule associated with this context? |
| public RuleContext | parent
What context invoked this rule? |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | accept(ParseTreeVisitor<? extends T> visitor)
Implements org. ParseTreeVisitor needs a double dispatch method.
|
| public int | |
| public int | getAltNumber()
For rule associated with this parse tree internal node, return the outer alternative number used to match the input. |
| public ParseTree | getChild(int i)
Implements org. ith value indexed from 0.
|
| public static RuleContext | |
| public int | getChildCount()
Implements org. |
| public RuleContext | |
| public RuleContext | getPayload()
Implements org. |
| public RuleContext | |
| public int | |
| public Interval | getSourceInterval()
Implements org. Interval indicating the index in the
TokenStream of the first and last token associated with this
subtree.
|
| public String | getText()
Implements org. |
| public boolean | |
| public void | |
| public void | |
| public String | |
| public final String | |
| public final String | |
| public String | |
| public String | |
| public String | toStringTree(Parser recog)
Implements org. |
| public String | toStringTree(List<String> ruleNames)
Print out a whole tree, not just a node, in LISP format (root child1 .. |
| public String | toStringTree()
Implements org. (root child1 ..
|
| invokingState | back to summary |
|---|---|
| public int invokingState 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. | |
| parent | back to summary |
|---|---|
| public RuleContext parent What context invoked this rule? | |
| RuleContext | back to summary |
|---|---|
| public RuleContext() | |
| RuleContext | back to summary |
|---|---|
| public RuleContext(RuleContext parent, int invokingState) | |
| accept | back to summary |
|---|---|
| public <T> T accept(ParseTreeVisitor<? extends T> visitor) Implements org. Doc from org. The
| |
| depth | back to summary |
|---|---|
| public int depth() | |
| getAltNumber | back to summary |
|---|---|
| public int getAltNumber() 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.
| |
| getChild | back to summary |
|---|---|
| public ParseTree getChild(int i) Implements org. Doc from org. If there are children, get the
| |
| getChildContext | back to summary |
|---|---|
| public static RuleContext getChildContext(RuleContext parent, int invokingState) | |
| 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 RuleContext 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 RuleContext 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
| |
| getRuleContext | back to summary |
|---|---|
| public RuleContext getRuleContext() Implements org.
| |
| getRuleIndex | back to summary |
|---|---|
| public int getRuleIndex() | |
| 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.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements org. Return the combined text of all child nodes. This method only considers tokens which have been added to the parse tree. Since tokens on hidden channels (e.g. whitespace or comments) are not added to the parse trees, they will not appear in the output of this method.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() A context is empty if there is no invoking state; meaning nobody called current context. | |
| setAltNumber | back to summary |
|---|---|
| public void setAltNumber(int altNumber) 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.
| |
| setParent | back to summary |
|---|---|
public void setParent(RuleContext parent)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| toString | back to summary |
|---|---|
| public final String toString(Recognizer<?, ?> recog) | |
| toString | back to summary |
|---|---|
| public final String toString(List<String> ruleNames) | |
| toString | back to summary |
|---|---|
| public String toString(Recognizer<?, ?> recog, RuleContext stop) | |
| toString | back to summary |
|---|---|
| public String toString(List<String> ruleNames, RuleContext stop) | |
| toStringTree | back to summary |
|---|---|
| public String toStringTree(Parser recog) Implements org. Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. We have to know the recognizer so we can get rule names.
| |
| toStringTree | back to summary |
|---|---|
| public String toStringTree(List<String> ruleNames) Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. | |
| toStringTree | back to summary |
|---|---|
| public String toStringTree() Implements org. Doc from org. Print out a whole tree, not just a node, in LISP format
| |