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, singleTokenInsertionpublic GrammarParserInterpreter.BailButConsumeErrorStrategy()
public void recover(Parser recognizer, RecognitionException e)
recover in interface ANTLRErrorStrategyrecover in class DefaultErrorStrategypublic Token recoverInline(Parser recognizer) throws RecognitionException
recoverInline in interface ANTLRErrorStrategyrecoverInline in class DefaultErrorStrategyRecognitionExceptionpublic void sync(Parser recognizer)
sync in interface ANTLRErrorStrategysync in class DefaultErrorStrategyCopyright © 1992–2020 ANTLR. All rights reserved.