类 TraceDebugEventListener
- java.lang.Object
-
- org.antlr.runtime.debug.BlankDebugEventListener
-
- org.antlr.runtime.debug.TraceDebugEventListener
-
- 所有已实现的接口:
DebugEventListener
public class TraceDebugEventListener extends BlankDebugEventListener
Print out (most of) the events... Useful for debugging, testing...
-
-
字段概要
-
从接口继承的字段 org.antlr.runtime.debug.DebugEventListener
FALSE, PROTOCOL_VERSION, TRUE
-
-
构造器概要
构造器 构造器 说明 TraceDebugEventListener(TreeAdaptor adaptor)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddChild(java.lang.Object root, java.lang.Object child)Make childID a child of rootID.voidbecomeRoot(java.lang.Object newRoot, java.lang.Object oldRoot)Make a node the new root of an existing root.voidconsumeNode(java.lang.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).voidcreateNode(java.lang.Object t)Announce a new node built from token elements such as type etc...voidcreateNode(java.lang.Object node, Token token)Announce a new node built from an existing token.voidenterRule(java.lang.String ruleName)voidenterSubRule(int decisionNumber)Track entry into any (...) subrule other EBNF constructvoidexitRule(java.lang.String ruleName)voidexitSubRule(int decisionNumber)voidlocation(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.voidLT(int i, java.lang.Object t)The tree parser lookedahead.voidnilNode(java.lang.Object t)A nil was created (even nil nodes have a unique ID...voidsetTokenBoundaries(java.lang.Object t, int tokenStartIndex, int tokenStopIndex)Set the token start/stop token index for a subtree root or node.-
从类继承的方法 org.antlr.runtime.debug.BlankDebugEventListener
beginBacktrack, beginResync, commence, consumeHiddenToken, consumeToken, endBacktrack, endResync, enterAlt, enterDecision, enterRule, errorNode, exitDecision, exitRule, LT, mark, recognitionException, rewind, rewind, semanticPredicate, terminate
-
-
-
-
构造器详细资料
-
TraceDebugEventListener
public TraceDebugEventListener(TreeAdaptor adaptor)
-
-
方法详细资料
-
enterRule
public void enterRule(java.lang.String ruleName)
-
exitRule
public void exitRule(java.lang.String ruleName)
-
enterSubRule
public void enterSubRule(int decisionNumber)
从接口复制的说明:DebugEventListenerTrack entry into any (...) subrule other EBNF construct- 指定者:
enterSubRule在接口中DebugEventListener- 覆盖:
enterSubRule在类中BlankDebugEventListener
-
exitSubRule
public void exitSubRule(int decisionNumber)
- 指定者:
exitSubRule在接口中DebugEventListener- 覆盖:
exitSubRule在类中BlankDebugEventListener
-
location
public void location(int line, int pos)从接口复制的说明:DebugEventListenerTo watch a parser move through the grammar, the parser needs to inform the debugger what line/charPos it is passing in the grammar. For now, this does not know how to switch from one grammar to the other and back for island grammars etc... This should also allow breakpoints because the debugger can stop the parser whenever it hits this line/pos.- 指定者:
location在接口中DebugEventListener- 覆盖:
location在类中BlankDebugEventListener
-
consumeNode
public void consumeNode(java.lang.Object t)
从接口复制的说明:DebugEventListenerInput 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). This is the analog of the consumeToken method. Again, the ID is the hashCode usually of the node so it only works if hashCode is not implemented. If the type is UP or DOWN, then the ID is not really meaningful as it's fixed--there is just one UP node and one DOWN navigation node.- 指定者:
consumeNode在接口中DebugEventListener- 覆盖:
consumeNode在类中BlankDebugEventListener
-
LT
public void LT(int i, java.lang.Object t)从接口复制的说明:DebugEventListenerThe tree parser lookedahead. If the type is UP or DOWN, then the ID is not really meaningful as it's fixed--there is just one UP node and one DOWN navigation node.- 指定者:
LT在接口中DebugEventListener- 覆盖:
LT在类中BlankDebugEventListener
-
nilNode
public void nilNode(java.lang.Object t)
从接口复制的说明:DebugEventListenerA nil was created (even nil nodes have a unique ID... they are not "null" per se). As of 4/28/2006, this seems to be uniquely triggered when starting a new subtree such as when entering a subrule in automatic mode and when building a tree in rewrite mode. If you are receiving this event over a socket via RemoteDebugEventSocketListener then only t.ID is set.- 指定者:
nilNode在接口中DebugEventListener- 覆盖:
nilNode在类中BlankDebugEventListener
-
createNode
public void createNode(java.lang.Object t)
从接口复制的说明:DebugEventListenerAnnounce a new node built from token elements such as type etc... If you are receiving this event over a socket via RemoteDebugEventSocketListener then only t.ID, type, text are set.- 指定者:
createNode在接口中DebugEventListener- 覆盖:
createNode在类中BlankDebugEventListener
-
createNode
public void createNode(java.lang.Object node, Token token)从接口复制的说明:DebugEventListenerAnnounce a new node built from an existing token. If you are receiving this event over a socket via RemoteDebugEventSocketListener then only node.ID and token.tokenIndex are set.- 指定者:
createNode在接口中DebugEventListener- 覆盖:
createNode在类中BlankDebugEventListener
-
becomeRoot
public void becomeRoot(java.lang.Object newRoot, java.lang.Object oldRoot)从接口复制的说明:DebugEventListenerMake a node the new root of an existing root. See Note: the newRootID parameter is possibly different than the TreeAdaptor.becomeRoot() newRoot parameter. In our case, it will always be the result of calling TreeAdaptor.becomeRoot() and not root_n or whatever. The listener should assume that this event occurs only when the current subrule (or rule) subtree is being reset to newRootID. If you are receiving this event over a socket via RemoteDebugEventSocketListener then only IDs are set.
-
addChild
public void addChild(java.lang.Object root, java.lang.Object child)从接口复制的说明:DebugEventListenerMake childID a child of rootID. If you are receiving this event over a socket via RemoteDebugEventSocketListener then only IDs are set.
-
setTokenBoundaries
public void setTokenBoundaries(java.lang.Object t, int tokenStartIndex, int tokenStopIndex)从接口复制的说明:DebugEventListenerSet the token start/stop token index for a subtree root or node. If you are receiving this event over a socket via RemoteDebugEventSocketListener then only t.ID is set.- 指定者:
setTokenBoundaries在接口中DebugEventListener- 覆盖:
setTokenBoundaries在类中BlankDebugEventListener
-
-