antlr3.RecognizerSharedState Class Reference

The set of fields needed by an abstract recognizer to recognize input and recover from errors etc. More...

List of all members.

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.


Detailed Description

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.

Definition at line 2460 of file antlr3.py.


Member Function Documentation

def antlr3.RecognizerSharedState.__init__ (   self  ) 

Definition at line 2462 of file antlr3.py.


Member Data Documentation

Definition at line 2465 of file antlr3.py.

Definition at line 2470 of file antlr3.py.

Definition at line 2477 of file antlr3.py.

Definition at line 2481 of file antlr3.py.

Definition at line 2489 of file antlr3.py.

Did the recognizer encounter a syntax error? Track how many.

Definition at line 2492 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.

Definition at line 2506 of file antlr3.py.

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.

Definition at line 2511 of file antlr3.py.

The line on which the first character of the token resides.

Definition at line 2514 of file antlr3.py.

The character position of first character within the line.

Definition at line 2517 of file antlr3.py.

The channel number for the current token.

Definition at line 2520 of file antlr3.py.

The token type for the current token.

Definition at line 2523 of file antlr3.py.

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.

Definition at line 2527 of file antlr3.py.


The documentation for this class was generated from the following file:

Generated on Mon Nov 29 17:24:28 2010 for ANTLR Python API by  doxygen 1.5.5