Top Fields Constructors Methods
org.antlr.runtime.debug

public Class DebugParser

extends Parser
Class Inheritance
Imports
org.antlr.runtime.*, java.io.IOException

Field Summary

Modifier and TypeField and Description
protected DebugEventListener
dbg

Who to notify when events in the parser occur.

public boolean
isCyclicDecision

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

Inherited from org.antlr.runtime.Parser:
input

Constructor Summary

AccessConstructor and Description
public
DebugParser(TokenStream input, DebugEventListener dbg, RecognizerSharedState state)

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

public
public

Method Summary

Modifier and TypeMethod and Description
public void
beginBacktrack(int level)

public void
beginResync()

Overrides org.antlr.runtime.BaseRecognizer.beginResync.

A hook to listen in on the token consumption during error recovery.
public void
endBacktrack(int level, boolean successful)

public void
public DebugEventListener
public void
public void
public void
setDebugListener(DebugEventListener dbg)

Provide a new debug event listener for this parser.

Inherited from org.antlr.runtime.Parser:
getCurrentInputSymbolgetMissingSymbolgetSourceNamegetTokenStreamresetsetTokenStreamtraceIntraceOut

Field Detail

dbgback to summary
protected DebugEventListener dbg

Who to notify when events in the parser occur.

isCyclicDecisionback to summary
public boolean isCyclicDecision

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

Constructor Detail

DebugParserback to summary
public DebugParser(TokenStream input, DebugEventListener dbg, RecognizerSharedState state)

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

DebugParserback to summary
public DebugParser(TokenStream input, RecognizerSharedState state)
DebugParserback to summary
public DebugParser(TokenStream input, DebugEventListener dbg)

Method Detail

beginBacktrackback to summary
public void beginBacktrack(int level)
beginResyncback to summary
public void beginResync()

Overrides org.antlr.runtime.BaseRecognizer.beginResync.

Doc from org.antlr.runtime.BaseRecognizer.beginResync.

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

Annotations
@Override
endBacktrackback to summary
public void endBacktrack(int level, boolean successful)
endResyncback to summary
public void endResync()

Overrides org.antlr.runtime.BaseRecognizer.endResync.

Annotations
@Override
getDebugListenerback to summary
public DebugEventListener getDebugListener()
reportErrorback to summary
public void reportError(IOException e)
reportErrorback to summary
public void reportError(RecognitionException e)

Overrides org.antlr.runtime.BaseRecognizer.reportError.

Doc from org.antlr.runtime.BaseRecognizer.reportError.

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.

Annotations
@Override
setDebugListenerback to summary
public void 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.