org.antlr.runtime.debug.DebugTreeParser Class Reference

Inheritance diagram for org.antlr.runtime.debug.DebugTreeParser:

Inheritance graph
[legend]
Collaboration diagram for org.antlr.runtime.debug.DebugTreeParser:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DebugTreeParser (TreeNodeStream input, DebugEventListener dbg, RecognizerSharedState state)
 DebugTreeParser (TreeNodeStream input, RecognizerSharedState state)
 DebugTreeParser (TreeNodeStream input, DebugEventListener dbg)
void setDebugListener (DebugEventListener dbg)
DebugEventListener getDebugListener ()
void reportError (IOException e)
void reportError (RecognitionException e)
void beginResync ()
void endResync ()
void beginBacktrack (int level)
void endBacktrack (int level, boolean successful)

Public Attributes

boolean isCyclicDecision = false

Protected Member Functions

Object getMissingSymbol (IntStream input, RecognitionException e, int expectedTokenType, BitSet follow)

Protected Attributes

DebugEventListener dbg = null


Detailed Description

Definition at line 36 of file DebugTreeParser.java.


Constructor & Destructor Documentation

org.antlr.runtime.debug.DebugTreeParser.DebugTreeParser ( TreeNodeStream  input,
DebugEventListener  dbg,
RecognizerSharedState  state 
)

Create a normal parser except wrap the token stream in a debug proxy that fires consume events.

Definition at line 48 of file DebugTreeParser.java.

org.antlr.runtime.debug.DebugTreeParser.DebugTreeParser ( TreeNodeStream  input,
RecognizerSharedState  state 
)

Definition at line 53 of file DebugTreeParser.java.

org.antlr.runtime.debug.DebugTreeParser.DebugTreeParser ( TreeNodeStream  input,
DebugEventListener  dbg 
)

Definition at line 57 of file DebugTreeParser.java.


Member Function Documentation

void org.antlr.runtime.debug.DebugTreeParser.setDebugListener ( DebugEventListener  dbg  ) 

Provide a new debug event listener for this parser. Notify the input stream too that it should send events to this listener.

Definition at line 64 of file DebugTreeParser.java.

DebugEventListener org.antlr.runtime.debug.DebugTreeParser.getDebugListener (  ) 

Definition at line 71 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.reportError ( IOException  e  ) 

Definition at line 75 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.reportError ( RecognitionException  e  ) 

Report a recognition problem.

This method sets errorRecovery to indicate the parser is recovering not parsing. Once in recovery mode, no errors are generated. To get out of recovery mode, the parser must successfully match a token (after a resync). So it will go:

1. error occurs 2. enter recovery mode, report error 3. consume until token found in resynch set 4. try to resume parsing 5. next match() will reset errorRecovery mode

If you override, make sure to update syntaxErrors if you care about that.

Reimplemented from org.antlr.runtime.BaseRecognizer.

Definition at line 80 of file DebugTreeParser.java.

Object org.antlr.runtime.debug.DebugTreeParser.getMissingSymbol ( IntStream  input,
RecognitionException  e,
int  expectedTokenType,
BitSet  follow 
) [protected]

Conjure up a missing token during error recovery.

The recognizer attempts to recover from single missing symbols. But, actions might refer to that missing symbol. For example, x=ID {f($x);}. The action clearly assumes that there has been an identifier matched previously and that $x points at that token. If that token is missing, but the next token in the stream is what we want we assume that this token is missing and we keep going. Because we have to return some token to replace the missing token, we have to conjure one up. This method gives the user control over the tokens returned for missing tokens. Mostly, you will want to create something special for identifier tokens. For literals such as '{' and ',', the default action in the parser or tree parser works. It simply creates a CommonToken of the appropriate type. The text will be the token. If you change what tokens must be created by the lexer, override this method to create the appropriate tokens.

Reimplemented from org.antlr.runtime.tree.TreeParser.

Definition at line 84 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.beginResync (  ) 

A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.

Reimplemented from org.antlr.runtime.BaseRecognizer.

Definition at line 94 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.endResync (  ) 

Reimplemented from org.antlr.runtime.BaseRecognizer.

Definition at line 98 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.beginBacktrack ( int  level  ) 

Definition at line 102 of file DebugTreeParser.java.

void org.antlr.runtime.debug.DebugTreeParser.endBacktrack ( int  level,
boolean  successful 
)

Definition at line 106 of file DebugTreeParser.java.


Member Data Documentation

Who to notify when events in the parser occur.

Definition at line 38 of file DebugTreeParser.java.

Used to differentiate between fixed lookahead and cyclic DFA decisions while profiling.

Definition at line 43 of file DebugTreeParser.java.


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

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