public class BailErrorStrategy extends DefaultErrorStrategy
myparser.setErrorHandler(new BailErrorStrategy());_factory, errorRecoveryMode, lastErrorIndex, lastErrorStates| Constructor and Description |
|---|
BailErrorStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
recover(Parser recognizer,
RecognitionException e)
Instead of recovering from exception
e, re-throw it wrapped
in a ParseCancellationException so it is not caught by the
rule function catches. |
Token |
recoverInline(Parser recognizer)
Make sure we don't attempt to recover inline; if the parser
successfully recovers, it won't throw an exception.
|
void |
sync(Parser recognizer)
Make sure we don't attempt to recover from problems in subrules.
|
beginErrorCondition, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, reportError, reportFailedPredicate, reportInputMismatch, reportMissingToken, reportNoViableAlternative, reportUnwantedToken, setTokenFactory, singleTokenDeletion, singleTokenInsertionpublic void recover(Parser recognizer, RecognitionException e)
e, re-throw it wrapped
in a ParseCancellationException so it is not caught by the
rule function catches. Use Throwable.getCause() to get the
original RecognitionException.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-2013 ANTLR. All Rights Reserved.