public class DebugEventRepeater extends Object implements DebugEventListener
DebugEventHub| Modifier and Type | Field and Description |
|---|---|
protected DebugEventListener |
listener |
FALSE, PROTOCOL_VERSION, TRUE| Constructor and Description |
|---|
DebugEventRepeater(DebugEventListener listener) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Object root,
Object child)
Make childID a child of rootID.
|
void |
becomeRoot(Object newRoot,
Object oldRoot)
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(Object t)
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(Object t)
Announce a new node built from token elements such as type etc...
|
void |
createNode(Object node,
Token token)
Announce a new node built from an existing token.
|
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,
boolean couldBacktrack)
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(String grammarFileName,
String ruleName)
The parser has just entered a rule.
|
void |
enterSubRule(int decisionNumber)
Track entry into any (...) subrule other EBNF construct
|
void |
errorNode(Object t)
Upon syntax error, recognizers bracket the error with an error node
if they are building ASTs.
|
void |
exitDecision(int decisionNumber) |
void |
exitRule(String grammarFileName,
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,
Object t)
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(Object t)
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,
String predicate)
A semantic predicate was evaluate with this result and action text
|
void |
setTokenBoundaries(Object t,
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.
|
protected DebugEventListener listener
public DebugEventRepeater(DebugEventListener listener)
public void enterRule(String grammarFileName, String ruleName)
DebugEventListenerenterRule in interface DebugEventListenerpublic void exitRule(String grammarFileName, String ruleName)
DebugEventListenerexitRule in interface DebugEventListenerpublic void enterAlt(int alt)
DebugEventListenerenterAlt in interface DebugEventListenerpublic void enterSubRule(int decisionNumber)
DebugEventListenerenterSubRule in interface DebugEventListenerpublic void exitSubRule(int decisionNumber)
exitSubRule in interface DebugEventListenerpublic void enterDecision(int decisionNumber,
boolean couldBacktrack)
DebugEventListenerenterDecision in interface DebugEventListenerpublic void exitDecision(int decisionNumber)
exitDecision in interface DebugEventListenerpublic void location(int line,
int pos)
DebugEventListenerlocation in interface DebugEventListenerpublic void consumeToken(Token token)
DebugEventListenerconsumeToken in interface DebugEventListenerpublic void consumeHiddenToken(Token token)
DebugEventListenerconsumeHiddenToken in interface DebugEventListenerpublic void LT(int i,
Token t)
DebugEventListenerLT in interface DebugEventListenerpublic void mark(int i)
DebugEventListenermark in interface DebugEventListenerpublic void rewind(int i)
DebugEventListenerrewind in interface DebugEventListenerpublic void rewind()
DebugEventListenerrewind in interface DebugEventListenerpublic void beginBacktrack(int level)
beginBacktrack in interface DebugEventListenerpublic void endBacktrack(int level,
boolean successful)
endBacktrack in interface DebugEventListenerpublic void recognitionException(RecognitionException e)
DebugEventListenerrecognitionException in interface DebugEventListenerpublic void beginResync()
DebugEventListenerbeginResync in interface DebugEventListenerpublic void endResync()
DebugEventListenerendResync in interface DebugEventListenerpublic void semanticPredicate(boolean result,
String predicate)
DebugEventListenersemanticPredicate in interface DebugEventListenerpublic void commence()
DebugEventListenercommence in interface DebugEventListenerpublic void terminate()
DebugEventListenerterminate in interface DebugEventListenerpublic void consumeNode(Object t)
DebugEventListenerconsumeNode in interface DebugEventListenerpublic void LT(int i,
Object t)
DebugEventListenerLT in interface DebugEventListenerpublic void nilNode(Object t)
DebugEventListenernilNode in interface DebugEventListenerpublic void errorNode(Object t)
DebugEventListenererrorNode in interface DebugEventListenerpublic void createNode(Object t)
DebugEventListenercreateNode in interface DebugEventListenerpublic void createNode(Object node, Token token)
DebugEventListenercreateNode in interface DebugEventListenerpublic void becomeRoot(Object newRoot, Object oldRoot)
DebugEventListenerbecomeRoot in interface DebugEventListenerTreeAdaptor.becomeRoot(java.lang.Object, java.lang.Object)public void addChild(Object root, Object child)
DebugEventListeneraddChild in interface DebugEventListenerTreeAdaptor.addChild(java.lang.Object, java.lang.Object)public void setTokenBoundaries(Object t, int tokenStartIndex, int tokenStopIndex)
DebugEventListenersetTokenBoundaries in interface DebugEventListenerCopyright © 1992-2013 ANTLR. All Rights Reserved.