Token object representing an entire subtree matched by a parser
rule; e.g., <expr>. These tokens are created for TagChunk
chunks where the tag corresponds to a parser rule.
| Modifier and Type | Field and Description |
|---|---|
| private final int | bypassTokenType
The token type for the current token. |
| private final String | |
| private final String | ruleName
This is the backing field for |
| Access | Constructor and Description |
|---|---|
| public | RuleTagToken(String
The name of the parser rule this rule tag matches. ruleName, int The bypass token type assigned to the parser rule. bypassTokenType)Constructs a new instance of |
| public | RuleTagToken(String
The name of the parser rule this rule tag matches. ruleName, int The bypass token type assigned to the parser rule. bypassTokenType, String The label associated with the rule tag, or label)null if
the rule tag is unlabeled.Constructs a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | getCharPositionInLine()
Implements org. The implementation for |
| public CharStream | getInputStream()
Implements org. CharStream from which this token was derived.
|
| public final String | Returns: The name of the label associated with the rule tag, ornull if this is an unlabeled rule tag.Gets the label associated with the rule tag. |
| public int | getLine()
Implements org. The implementation for |
| public final String | Returns: The name of the parser rule associated with this rule tag.Gets the name of the rule associated with this rule tag. |
| public int | getStartIndex()
Implements org. |
| public int | getStopIndex()
Implements org. |
| public String | |
| public int | getTokenIndex()
Implements org. |
| public TokenSource | getTokenSource()
Implements org. TokenSource which created this token.
|
| public int | getType()
Implements org. Rule tag tokens have types assigned according to the rule bypass transitions created during ATN deserialization. |
| public String |
| bypassTokenType | back to summary |
|---|---|
| private final int bypassTokenType The token type for the current token. This is the token type assigned to the bypass alternative for the rule during ATN deserialization. | |
| label | back to summary |
|---|---|
| private final String label This is the backing field for | |
| ruleName | back to summary |
|---|---|
| private final String ruleName This is the backing field for | |
| RuleTagToken | back to summary |
|---|---|
| public RuleTagToken(String ruleName, int bypassTokenType) Constructs a new instance of
| |
| RuleTagToken | back to summary |
|---|---|
| public RuleTagToken(String ruleName, int bypassTokenType, String label) Constructs a new instance of
| |
| getChannel | back to summary |
|---|---|
| public int getChannel() Implements org. Doc from org. Return the channel this token. Each token can arrive at the parser on a different channel, but the parser only "tunes" to a single channel. The parser ignores everything not on DEFAULT_CHANNEL. Rule tag tokens are always placed on the
| |
| getCharPositionInLine | back to summary |
|---|---|
| public int getCharPositionInLine() Implements org. Doc from org. The index of the first character of this token relative to the beginning of the line at which it occurs, 0..n-1 The implementation for
| |
| getInputStream | back to summary |
|---|---|
| public CharStream getInputStream() Implements org. Doc from org. Gets the The implementation for
| |
| getLabel | back to summary |
|---|---|
| public final String getLabel() Gets the label associated with the rule tag. | |
| getLine | back to summary |
|---|---|
| public int getLine() Implements org. Doc from org. The line number on which the 1st character of this token was matched, line=1..n The implementation for
| |
| getRuleName | back to summary |
|---|---|
| public final String getRuleName() Gets the name of the rule associated with this rule tag. | |
| getStartIndex | back to summary |
|---|---|
| public int getStartIndex() Implements org. Doc from org. The starting character index of the token This method is optional; return -1 if not implemented. The implementation for
| |
| getStopIndex | back to summary |
|---|---|
| public int getStopIndex() Implements org. Doc from org. The last character index of the token. This method is optional; return -1 if not implemented. The implementation for
| |
| getText | back to summary |
|---|---|
| public String getText() Implements org. Doc from org. Get the text of the token. This method returns the rule tag formatted with
| |
| getTokenIndex | back to summary |
|---|---|
| public int getTokenIndex() Implements org. Doc from org. An index from 0..n-1 of the token object in the input stream. This must be valid in order to print token streams and use TokenRewriteStream. Return -1 to indicate that this token was conjured up since it doesn't have a valid index. The implementation for
| |
| getTokenSource | back to summary |
|---|---|
| public TokenSource getTokenSource() Implements org. Doc from org. Gets the The implementation for
| |
| getType | back to summary |
|---|---|
| public int getType() Implements org. Doc from org. Get the token type of the token Rule tag tokens have types assigned according to the rule bypass transitions created during ATN deserialization.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. The implementation for | |