|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.runtime.RecognizerSharedState
public class RecognizerSharedState
The set of fields needed by an abstract recognizer to recognize input and recover from errors etc... As a separate state object, it can be shared among multiple grammars; e.g., when one grammar imports another. These fields are publically visible but the actual state pointer per parser is protected.
Field Summary | |
---|---|
int |
_fsp
|
int |
backtracking
If 0, no backtracking is going on. |
int |
channel
The channel number for the current token |
boolean |
errorRecovery
This is true when we see an error and before having successfully matched a token. |
boolean |
failed
In lieu of a return value, this indicates that a rule or token has failed to match. |
BitSet[] |
following
Track the set of token types that can follow any rule invocation. |
int |
lastErrorIndex
The index into the input stream where the last error occurred. |
java.util.Map[] |
ruleMemo
An array[size num rules] of Map |
int |
syntaxErrors
Did the recognizer encounter a syntax error? Track how many. |
java.lang.String |
text
You can set the text for the current token to override what is in the input char buffer. |
Token |
token
The goal of all lexer rules/methods is to create a token object. |
int |
tokenStartCharIndex
What character index in the stream did the current token start at? Needed, for example, to get the text for current token. |
int |
tokenStartCharPositionInLine
The character position of first character within the line |
int |
tokenStartLine
The line on which the first character of the token resides |
int |
type
The token type for the current token |
Constructor Summary | |
---|---|
RecognizerSharedState()
|
|
RecognizerSharedState(RecognizerSharedState state)
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public BitSet[] following
public int _fsp
public boolean errorRecovery
public int lastErrorIndex
public boolean failed
public int syntaxErrors
public int backtracking
public java.util.Map[] ruleMemo
public Token token
public int tokenStartCharIndex
public int tokenStartLine
public int tokenStartCharPositionInLine
public int channel
public int type
public java.lang.String text
Constructor Detail |
---|
public RecognizerSharedState()
public RecognizerSharedState(RecognizerSharedState state)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |