Public Member Functions | |
def | __init__ |
Public Attributes | |
following | |
errorRecovery | |
lastErrorIndex | |
backtracking | |
ruleMemo | |
syntaxErrors | |
Did the recognizer encounter a syntax error? Track how many. | |
token | |
The goal of all lexer rules/methods is to create a token object. | |
tokenStartCharIndex | |
What character index in the stream did the current token start at? Needed, for example, to get the text for current token. | |
tokenStartLine | |
The line on which the first character of the token resides. | |
tokenStartCharPositionInLine | |
The character position of first character within the line. | |
channel | |
The channel number for the current token. | |
type | |
The token type for the current token. | |
text | |
You can set the text for the current token to override what is in the input char buffer. |
.. 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.
Definition at line 2460 of file antlr3.py.
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.