Antlr.Runtime.DFA Class Reference

A DFA implemented as a set of transition tables. More...

Collaboration diagram for Antlr.Runtime.DFA:

Collaboration graph
[legend]

List of all members.

Public Member Functions

delegate int SpecialStateTransitionHandler (DFA dfa, int s, IIntStream input)
int Predict (IIntStream input)
 From the input stream, predict what alternative will succeed using this DFA (representing the covering regular approximation to the underlying CFL).
virtual void Error (NoViableAltException nvae)
 A hook for debugging interface.
virtual int SpecialStateTransition (int s, IIntStream input)
int SpecialTransition (int state, int symbol)

Static Public Member Functions

static short[] UnpackEncodedString (string encodedString)
static short[][] UnpackEncodedStringArray (string[] encodedStrings)
static char[] UnpackEncodedStringToUnsignedChars (string encodedString)

Public Attributes

SpecialStateTransitionHandler specialStateTransitionHandler
const bool debug = false

Protected Member Functions

void NoViableAlt (int s, IIntStream input)

Protected Attributes

short[] eot
short[] eof
char[] min
char[] max
short[] accept
short[] special
short[][] transition
int decisionNumber
BaseRecognizer recognizer
 Which recognizer encloses this DFA? Needed to check backtracking.

Properties

virtual string Description [get]


Detailed Description

A DFA implemented as a set of transition tables.

Any state that has a semantic predicate edge is special; those states are generated with if-then-else structures in a SpecialStateTransition() which is generated by cyclicDFA template.

There are at most 32767 states (16-bit signed short). Could get away with byte sometimes but would have to generate different types and the simulation code too.

As a point of reference, the Tokens rule DFA for the lexer in the Java grammar sample has approximately 326 states.

Definition at line 57 of file DFA.cs.


Member Function Documentation

delegate int Antlr.Runtime.DFA.SpecialStateTransitionHandler ( DFA  dfa,
int  s,
IIntStream  input 
)

int Antlr.Runtime.DFA.Predict ( IIntStream  input  ) 

From the input stream, predict what alternative will succeed using this DFA (representing the covering regular approximation to the underlying CFL).

Parameters:
input Input stream
Returns:
Return an alternative number 1..n. Throw an exception upon error.

Definition at line 87 of file DFA.cs.

void Antlr.Runtime.DFA.NoViableAlt ( int  s,
IIntStream  input 
) [protected]

Definition at line 189 of file DFA.cs.

virtual void Antlr.Runtime.DFA.Error ( NoViableAltException  nvae  )  [virtual]

A hook for debugging interface.

Parameters:
nvae 

Definition at line 209 of file DFA.cs.

virtual int Antlr.Runtime.DFA.SpecialStateTransition ( int  s,
IIntStream  input 
) [virtual]

Definition at line 211 of file DFA.cs.

static short [] Antlr.Runtime.DFA.UnpackEncodedString ( string  encodedString  )  [static]

Definition at line 221 of file DFA.cs.

static short [][] Antlr.Runtime.DFA.UnpackEncodedStringArray ( string[]  encodedStrings  )  [static]

Definition at line 240 of file DFA.cs.

static char [] Antlr.Runtime.DFA.UnpackEncodedStringToUnsignedChars ( string  encodedString  )  [static]

Definition at line 247 of file DFA.cs.

int Antlr.Runtime.DFA.SpecialTransition ( int  state,
int  symbol 
)

Definition at line 267 of file DFA.cs.


Member Data Documentation

short [] Antlr.Runtime.DFA.eot [protected]

Definition at line 61 of file DFA.cs.

short [] Antlr.Runtime.DFA.eof [protected]

Definition at line 62 of file DFA.cs.

char [] Antlr.Runtime.DFA.min [protected]

Definition at line 63 of file DFA.cs.

char [] Antlr.Runtime.DFA.max [protected]

Definition at line 64 of file DFA.cs.

short [] Antlr.Runtime.DFA.accept [protected]

Definition at line 65 of file DFA.cs.

short [] Antlr.Runtime.DFA.special [protected]

Definition at line 66 of file DFA.cs.

short [][] Antlr.Runtime.DFA.transition [protected]

Definition at line 67 of file DFA.cs.

Definition at line 69 of file DFA.cs.

SpecialStateTransitionHandler Antlr.Runtime.DFA.specialStateTransitionHandler

Definition at line 72 of file DFA.cs.

Which recognizer encloses this DFA? Needed to check backtracking.

Definition at line 77 of file DFA.cs.

const bool Antlr.Runtime.DFA.debug = false

Definition at line 79 of file DFA.cs.


Property Documentation

virtual string Antlr.Runtime.DFA.Description [get]

Definition at line 217 of file DFA.cs.


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

Generated on Wed Oct 1 14:13:24 2008 for ANTLR API by  doxygen 1.5.5