public static class GrammarParserInterpreter.BailButConsumeErrorStrategy extends DefaultErrorStrategy
BailErrorStrategy
as consume() constructs trees. We make sure
to create an error node during recovery with this strategy. We
consume() 1 token during the "bail out of rule" mechanism in recover()
and let it fall out of the rule to finish constructing trees. For
recovery in line, we throw InputMismatchException to engage recover().Modifier and Type | Field and Description |
---|---|
int |
firstErrorTokenIndex |
errorRecoveryMode, lastErrorIndex, lastErrorStates, nextTokensContext, nextTokensState
Constructor and Description |
---|
GrammarParserInterpreter.BailButConsumeErrorStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
recover(Parser recognizer,
RecognitionException e) |
Token |
recoverInline(Parser recognizer) |
void |
sync(Parser recognizer) |
beginErrorCondition, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, reportError, reportFailedPredicate, reportInputMismatch, reportMatch, reportMissingToken, reportNoViableAlternative, reportUnwantedToken, reset, singleTokenDeletion, singleTokenInsertion
public GrammarParserInterpreter.BailButConsumeErrorStrategy()
public void recover(Parser recognizer, RecognitionException e)
recover
in interface ANTLRErrorStrategy
recover
in class DefaultErrorStrategy
public Token recoverInline(Parser recognizer) throws RecognitionException
recoverInline
in interface ANTLRErrorStrategy
recoverInline
in class DefaultErrorStrategy
RecognitionException
public void sync(Parser recognizer)
sync
in interface ANTLRErrorStrategy
sync
in class DefaultErrorStrategy
Copyright © 1992–2020 ANTLR. All rights reserved.