public static class GrammarParserInterpreter.BailButConsumeErrorStrategy
extends org.antlr.v4.runtime.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 |
| Constructor and Description |
|---|
BailButConsumeErrorStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
recover(org.antlr.v4.runtime.Parser recognizer,
org.antlr.v4.runtime.RecognitionException e) |
org.antlr.v4.runtime.Token |
recoverInline(org.antlr.v4.runtime.Parser recognizer) |
void |
sync(org.antlr.v4.runtime.Parser recognizer) |
beginErrorCondition, constructToken, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, notifyErrorListeners, reportError, reportFailedPredicate, reportInputMismatch, reportMatch, reportMissingToken, reportNoViableAlternative, reportUnwantedToken, reset, singleTokenDeletion, singleTokenInsertionpublic void recover(org.antlr.v4.runtime.Parser recognizer,
org.antlr.v4.runtime.RecognitionException e)
recover in interface org.antlr.v4.runtime.ANTLRErrorStrategyrecover in class org.antlr.v4.runtime.DefaultErrorStrategypublic org.antlr.v4.runtime.Token recoverInline(org.antlr.v4.runtime.Parser recognizer)
throws org.antlr.v4.runtime.RecognitionException
recoverInline in interface org.antlr.v4.runtime.ANTLRErrorStrategyrecoverInline in class org.antlr.v4.runtime.DefaultErrorStrategyorg.antlr.v4.runtime.RecognitionExceptionpublic void sync(org.antlr.v4.runtime.Parser recognizer)
sync in interface org.antlr.v4.runtime.ANTLRErrorStrategysync in class org.antlr.v4.runtime.DefaultErrorStrategyCopyright © 1992–2022 Daniel Sun. All rights reserved.