| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public int | backtracking
If 0, no backtracking is going on. |
| public int | channel
The channel number for the current token |
| public boolean | errorRecovery
This is true when we see an error and before having successfully matched a token. |
| public boolean | failed
In lieu of a return value, this indicates that a rule or token has failed to match. |
| public BitSet[] | following
Track the set of token types that can follow any rule invocation. |
| public int | lastErrorIndex
The index into the input stream where the last error occurred. |
| public Map | ruleMemo
An array[size num rules] of Map<Integer,Integer> that tracks the stop token index for each rule. |
| public int | syntaxErrors
Did the recognizer encounter a syntax error? |
| public String | text
You can set the text for the current token to override what is in the input char buffer. |
| public Token | token
The goal of all lexer rules/methods is to create a token object. |
| public int | tokenStartCharIndex
What character index in the stream did the current token start at? |
| public int | tokenStartCharPositionInLine
The character position of first character within the line |
| public int | tokenStartLine
The line on which the first character of the token resides |
| public int | type
The token type for the current token |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| _fsp | back to summary |
|---|---|
| public int _fsp | |
| backtracking | back to summary |
|---|---|
| public int backtracking If 0, no backtracking is going on. Safe to exec actions etc... If >0 then it's the level of backtracking. | |
| channel | back to summary |
|---|---|
| public int channel The channel number for the current token | |
| errorRecovery | back to summary |
|---|---|
| public boolean errorRecovery This is true when we see an error and before having successfully matched a token. Prevents generation of more than one error message per error. | |
| failed | back to summary |
|---|---|
| public boolean failed In lieu of a return value, this indicates that a rule or token has failed to match. Reset to false upon valid token match. | |
| following | back to summary |
|---|---|
| public BitSet[] following Track the set of token types that can follow any rule invocation. Stack grows upwards. When it hits the max, it grows 2x in size and keeps going. | |
| lastErrorIndex | back to summary |
|---|---|
| public int lastErrorIndex The index into the input stream where the last error occurred. This is used to prevent infinite loops where an error is found but no token is consumed during recovery...another error is found, ad naseum. This is a failsafe mechanism to guarantee that at least one token/tree node is consumed for two errors. | |
| ruleMemo | back to summary |
|---|---|
| public Map<Integer, Integer>[] ruleMemo An array[size num rules] of Map<Integer,Integer> that tracks the stop token index for each rule. ruleMemo[ruleIndex] is the memoization table for ruleIndex. For key ruleStartIndex, you get back the stop token for associated rule or MEMO_RULE_FAILED. This is only used if rule memoization is on (which it is by default). | |
| syntaxErrors | back to summary |
|---|---|
| public int syntaxErrors Did the recognizer encounter a syntax error? Track how many. | |
| text | back to summary |
|---|---|
| public String text You can set the text for the current token to override what is in the input char buffer. Use setText() or can set this instance var. | |
| token | back to summary |
|---|---|
| public Token token The goal of all lexer rules/methods is to create a token object. This is an instance variable as multiple rules may collaborate to create a single token. nextToken will return this object after matching lexer rule(s). If you subclass to allow multiple token emissions, then set this to the last token to be matched or something nonnull so that the auto token emit mechanism will not emit another token. | |
| tokenStartCharIndex | back to summary |
|---|---|
| public int tokenStartCharIndex What character index in the stream did the current token start at? Needed, for example, to get the text for current token. Set at the start of nextToken. | |
| tokenStartCharPositionInLine | back to summary |
|---|---|
| public int tokenStartCharPositionInLine The character position of first character within the line | |
| tokenStartLine | back to summary |
|---|---|
| public int tokenStartLine The line on which the first character of the token resides | |
| type | back to summary |
|---|---|
| public int type The token type for the current token | |
| RecognizerSharedState | back to summary |
|---|---|
| public RecognizerSharedState() | |
| RecognizerSharedState | back to summary |
|---|---|
public RecognizerSharedState(RecognizerSharedState state)
| |