org.antlr.runtime.debug
Class Tracer

java.lang.Object
  extended by org.antlr.runtime.debug.BlankDebugEventListener
      extended by org.antlr.runtime.debug.Tracer
All Implemented Interfaces:
DebugEventListener

public class Tracer
extends BlankDebugEventListener

The default tracer mimics the traceParser behavior of ANTLR 2.x. This listens for debugging events from the parser and implies that you cannot debug and trace at the same time.


Field Summary
 IntStream input
           
protected  int level
           
 
Fields inherited from interface org.antlr.runtime.debug.DebugEventListener
FALSE, PROTOCOL_VERSION, TRUE
 
Constructor Summary
Tracer(IntStream input)
           
 
Method Summary
 void enterRule(java.lang.String ruleName)
          The parser has just entered a rule.
 void exitRule(java.lang.String ruleName)
          This is the last thing executed before leaving a rule.
 java.lang.Object getInputSymbol(int k)
           
 
Methods inherited from class org.antlr.runtime.debug.BlankDebugEventListener
addChild, becomeRoot, beginBacktrack, beginResync, commence, consumeHiddenToken, consumeNode, consumeToken, createNode, createNode, endBacktrack, endResync, enterAlt, enterDecision, enterSubRule, exitDecision, exitSubRule, location, LT, LT, mark, nilNode, recognitionException, rewind, rewind, semanticPredicate, setTokenBoundaries, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

public IntStream input

level

protected int level
Constructor Detail

Tracer

public Tracer(IntStream input)
Method Detail

enterRule

public void enterRule(java.lang.String ruleName)
Description copied from interface: DebugEventListener
The parser has just entered a rule. No decision has been made about which alt is predicted. This is fired AFTER init actions have been executed. Attributes are defined and available etc...

Specified by:
enterRule in interface DebugEventListener
Overrides:
enterRule in class BlankDebugEventListener

exitRule

public void exitRule(java.lang.String ruleName)
Description copied from interface: DebugEventListener
This is the last thing executed before leaving a rule. It is executed even if an exception is thrown. This is triggered after error reporting and recovery have occurred (unless the exception is not caught in this rule). This implies an "exitAlt" event.

Specified by:
exitRule in interface DebugEventListener
Overrides:
exitRule in class BlankDebugEventListener

getInputSymbol

public java.lang.Object getInputSymbol(int k)