public class Parser extends BaseRecognizer
Modifier and Type | Field and Description |
---|---|
TokenStream |
input |
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
Constructor and Description |
---|
Parser(TokenStream input) |
Parser(TokenStream input,
RecognizerSharedState state) |
Modifier and Type | Method and Description |
---|---|
protected Object |
getCurrentInputSymbol(IntStream input)
Match needs to return the current input symbol, which gets put
into the label for the associated token ref; e.g., x=ID.
|
protected Object |
getMissingSymbol(IntStream input,
RecognitionException e,
int expectedTokenType,
BitSet follow)
Conjure up a missing token during error recovery.
|
String |
getSourceName() |
TokenStream |
getTokenStream() |
void |
reset()
reset the parser's state; subclasses must rewinds the input stream
|
void |
setTokenStream(TokenStream input)
Set the token stream and reset the parser
|
void |
traceIn(String ruleName,
int ruleIndex) |
void |
traceOut(String ruleName,
int ruleIndex) |
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, endResync, failed, getBacktrackingLevel, getErrorHeader, getErrorMessage, getGrammarFileName, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, matchAny, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, reportError, setBacktrackingLevel, toStrings, traceIn, traceOut
public TokenStream input
public Parser(TokenStream input)
public Parser(TokenStream input, RecognizerSharedState state)
public void reset()
BaseRecognizer
reset
in class BaseRecognizer
protected Object getCurrentInputSymbol(IntStream input)
BaseRecognizer
getCurrentInputSymbol
in class BaseRecognizer
protected Object getMissingSymbol(IntStream input, RecognitionException e, int expectedTokenType, BitSet follow)
BaseRecognizer
getMissingSymbol
in class BaseRecognizer
public void setTokenStream(TokenStream input)
public TokenStream getTokenStream()
public String getSourceName()
getSourceName
in class BaseRecognizer
public void traceIn(String ruleName, int ruleIndex)
public void traceOut(String ruleName, int ruleIndex)
Copyright © 1992–2015 ANTLR. All rights reserved.