|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.runtime.debug.DebugEventRepeater
public class DebugEventRepeater
A simple event repeater (proxy) that delegates all functionality to the listener sent into the ctor. Useful if you want to listen in on a few debug events w/o interrupting the debugger. Just subclass the repeater and override the methods you want to listen in on. Remember to call the method in this class so the event will continue on to the original recipient.
DebugEventHub
Field Summary | |
---|---|
protected DebugEventListener |
listener
|
Fields inherited from interface org.antlr.runtime.debug.DebugEventListener |
---|
FALSE, PROTOCOL_VERSION, TRUE |
Constructor Summary | |
---|---|
DebugEventRepeater(DebugEventListener listener)
|
Method Summary | |
---|---|
void |
addChild(int rootID,
int childID)
Make childID a child of rootID. |
void |
becomeRoot(int newRootID,
int oldRootID)
Make a node the new root of an existing root. |
void |
beginBacktrack(int level)
|
void |
beginResync()
Indicates the recognizer is about to consume tokens to resynchronize the parser. |
void |
commence()
Announce that parsing has begun. |
void |
consumeHiddenToken(Token token)
An off-channel input token was consumed. |
void |
consumeNode(int ID,
java.lang.String text,
int type)
Input for a tree parser is an AST, but we know nothing for sure about a node except its type and text (obtained from the adaptor). |
void |
consumeToken(Token token)
An input token was consumed; matched by any kind of element. |
void |
createNode(int ID,
int tokenIndex)
Announce a new node built from an existing token |
void |
createNode(int ID,
java.lang.String text,
int type)
Announce a new node built from text |
void |
endBacktrack(int level,
boolean successful)
|
void |
endResync()
Indicates that the recognizer has finished consuming tokens in order to resychronize. |
void |
enterAlt(int alt)
Because rules can have lots of alternatives, it is very useful to know which alt you are entering. |
void |
enterDecision(int decisionNumber)
Every decision, fixed k or arbitrary, has an enter/exit event so that a GUI can easily track what LT/consume events are associated with prediction. |
void |
enterRule(java.lang.String ruleName)
The parser has just entered a rule. |
void |
enterSubRule(int decisionNumber)
Track entry into any (...) subrule other EBNF construct |
void |
exitDecision(int decisionNumber)
|
void |
exitRule(java.lang.String ruleName)
This is the last thing executed before leaving a rule. |
void |
exitSubRule(int decisionNumber)
|
void |
location(int line,
int pos)
To watch a parser move through the grammar, the parser needs to inform the debugger what line/charPos it is passing in the grammar. |
void |
LT(int i,
int ID,
java.lang.String text,
int type)
The tree parser lookedahead. |
void |
LT(int i,
Token t)
Somebody (anybody) looked ahead. |
void |
mark(int i)
The parser is going to look arbitrarily ahead; mark this location, the token stream's marker is sent in case you need it. |
void |
nilNode(int ID)
A nil was created (even nil nodes have a unique ID... |
void |
recognitionException(RecognitionException e)
A recognition exception occurred such as NoViableAltException. |
void |
rewind()
Rewind to the input position of the last marker. |
void |
rewind(int i)
After an arbitrairly long lookahead as with a cyclic DFA (or with any backtrack), this informs the debugger that stream should be rewound to the position associated with marker. |
void |
semanticPredicate(boolean result,
java.lang.String predicate)
A semantic predicate was evaluate with this result and action text |
void |
setTokenBoundaries(int ID,
int tokenStartIndex,
int tokenStopIndex)
Set the token start/stop token index for a subtree root or node |
void |
terminate()
Parsing is over; successfully or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DebugEventListener listener
Constructor Detail |
---|
public DebugEventRepeater(DebugEventListener listener)
Method Detail |
---|
public void enterRule(java.lang.String ruleName)
DebugEventListener
enterRule
in interface DebugEventListener
public void exitRule(java.lang.String ruleName)
DebugEventListener
exitRule
in interface DebugEventListener
public void enterAlt(int alt)
DebugEventListener
enterAlt
in interface DebugEventListener
public void enterSubRule(int decisionNumber)
DebugEventListener
enterSubRule
in interface DebugEventListener
public void exitSubRule(int decisionNumber)
exitSubRule
in interface DebugEventListener
public void enterDecision(int decisionNumber)
DebugEventListener
enterDecision
in interface DebugEventListener
public void exitDecision(int decisionNumber)
exitDecision
in interface DebugEventListener
public void location(int line, int pos)
DebugEventListener
location
in interface DebugEventListener
public void consumeToken(Token token)
DebugEventListener
consumeToken
in interface DebugEventListener
public void consumeHiddenToken(Token token)
DebugEventListener
consumeHiddenToken
in interface DebugEventListener
public void LT(int i, Token t)
DebugEventListener
LT
in interface DebugEventListener
public void mark(int i)
DebugEventListener
mark
in interface DebugEventListener
public void rewind(int i)
DebugEventListener
rewind
in interface DebugEventListener
public void rewind()
DebugEventListener
rewind
in interface DebugEventListener
public void beginBacktrack(int level)
beginBacktrack
in interface DebugEventListener
public void endBacktrack(int level, boolean successful)
endBacktrack
in interface DebugEventListener
public void recognitionException(RecognitionException e)
DebugEventListener
recognitionException
in interface DebugEventListener
public void beginResync()
DebugEventListener
beginResync
in interface DebugEventListener
public void endResync()
DebugEventListener
endResync
in interface DebugEventListener
public void semanticPredicate(boolean result, java.lang.String predicate)
DebugEventListener
semanticPredicate
in interface DebugEventListener
public void commence()
DebugEventListener
commence
in interface DebugEventListener
public void terminate()
DebugEventListener
terminate
in interface DebugEventListener
public void consumeNode(int ID, java.lang.String text, int type)
DebugEventListener
consumeNode
in interface DebugEventListener
public void LT(int i, int ID, java.lang.String text, int type)
DebugEventListener
LT
in interface DebugEventListener
public void nilNode(int ID)
DebugEventListener
nilNode
in interface DebugEventListener
public void createNode(int ID, java.lang.String text, int type)
DebugEventListener
createNode
in interface DebugEventListener
public void createNode(int ID, int tokenIndex)
DebugEventListener
createNode
in interface DebugEventListener
public void becomeRoot(int newRootID, int oldRootID)
DebugEventListener
becomeRoot
in interface DebugEventListener
org.antlr.runtime.tree.TreeAdaptor.becomeRoot()
public void addChild(int rootID, int childID)
DebugEventListener
addChild
in interface DebugEventListener
org.antlr.runtime.tree.TreeAdaptor.addChild()
public void setTokenBoundaries(int ID, int tokenStartIndex, int tokenStopIndex)
DebugEventListener
setTokenBoundaries
in interface DebugEventListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |