类 DebugTreeParser
- java.lang.Object
-
- org.antlr.runtime.BaseRecognizer
-
- org.antlr.runtime.tree.TreeParser
-
- org.antlr.runtime.debug.DebugTreeParser
-
public class DebugTreeParser extends TreeParser
-
-
字段概要
字段 修饰符和类型 字段 说明 protected DebugEventListener
dbg
Who to notify when events in the parser occur.boolean
isCyclicDecision
Used to differentiate between fixed lookahead and cyclic DFA decisions while profiling.-
从类继承的字段 org.antlr.runtime.tree.TreeParser
DOWN, input, UP
-
从类继承的字段 org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
-
构造器概要
构造器 构造器 说明 DebugTreeParser(TreeNodeStream input, DebugEventListener dbg)
DebugTreeParser(TreeNodeStream input, DebugEventListener dbg, RecognizerSharedState state)
Create a normal parser except wrap the token stream in a debug proxy that fires consume events.DebugTreeParser(TreeNodeStream input, RecognizerSharedState state)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
beginBacktrack(int level)
void
beginResync()
A hook to listen in on the token consumption during error recovery.void
endBacktrack(int level, boolean successful)
void
endResync()
DebugEventListener
getDebugListener()
protected java.lang.Object
getMissingSymbol(IntStream input, RecognitionException e, int expectedTokenType, BitSet follow)
Conjure up a missing token during error recovery.void
reportError(java.io.IOException e)
void
reportError(RecognitionException e)
Report a recognition problem.void
setDebugListener(DebugEventListener dbg)
Provide a new debug event listener for this parser.-
从类继承的方法 org.antlr.runtime.tree.TreeParser
getAncestor, getCurrentInputSymbol, getErrorHeader, getErrorMessage, getSourceName, getTreeNodeStream, inContext, inContext, matchAny, recoverFromMismatchedToken, reset, setTreeNodeStream, traceIn, traceOut
-
从类继承的方法 org.antlr.runtime.BaseRecognizer
alreadyParsedRule, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, failed, getBacktrackingLevel, getGrammarFileName, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, setBacktrackingLevel, toStrings, traceIn, traceOut
-
-
-
-
字段详细资料
-
dbg
protected DebugEventListener dbg
Who to notify when events in the parser occur.
-
isCyclicDecision
public boolean isCyclicDecision
Used to differentiate between fixed lookahead and cyclic DFA decisions while profiling.
-
-
构造器详细资料
-
DebugTreeParser
public DebugTreeParser(TreeNodeStream input, DebugEventListener dbg, RecognizerSharedState state)
Create a normal parser except wrap the token stream in a debug proxy that fires consume events.
-
DebugTreeParser
public DebugTreeParser(TreeNodeStream input, RecognizerSharedState state)
-
DebugTreeParser
public DebugTreeParser(TreeNodeStream input, DebugEventListener dbg)
-
-
方法详细资料
-
setDebugListener
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.
-
getDebugListener
public DebugEventListener getDebugListener()
-
reportError
public void reportError(java.io.IOException e)
-
reportError
public void reportError(RecognitionException e)
从类复制的说明:BaseRecognizer
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.- 覆盖:
reportError
在类中BaseRecognizer
-
getMissingSymbol
protected java.lang.Object getMissingSymbol(IntStream input, RecognitionException e, int expectedTokenType, BitSet follow)
从类复制的说明:BaseRecognizer
Conjure up a missing token during error recovery. The recognizer attempts to recover from single missing symbols. But, actions might refer to that missing symbol. For example, x=ID {f($x);}. The action clearly assumes that there has been an identifier matched previously and that $x points at that token. If that token is missing, but the next token in the stream is what we want we assume that this token is missing and we keep going. Because we have to return some token to replace the missing token, we have to conjure one up. This method gives the user control over the tokens returned for missing tokens. Mostly, you will want to create something special for identifier tokens. For literals such as '{' and ',', the default action in the parser or tree parser works. It simply creates a CommonToken of the appropriate type. The text will be the token. If you change what tokens must be created by the lexer, override this method to create the appropriate tokens.- 覆盖:
getMissingSymbol
在类中TreeParser
-
beginResync
public void beginResync()
从类复制的说明:BaseRecognizer
A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.- 覆盖:
beginResync
在类中BaseRecognizer
-
endResync
public void endResync()
- 覆盖:
endResync
在类中BaseRecognizer
-
beginBacktrack
public void beginBacktrack(int level)
-
endBacktrack
public void endBacktrack(int level, boolean successful)
-
-