Class DescriptiveErrorStrategy
java.lang.Object
org.antlr.v4.runtime.DefaultErrorStrategy
org.antlr.v4.runtime.BailErrorStrategy
org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy
- All Implemented Interfaces:
- org.antlr.v4.runtime.ANTLRErrorStrategy
public class DescriptiveErrorStrategy
extends org.antlr.v4.runtime.BailErrorStrategy
Provide friendly error messages when parsing errors occurred.
- 
Field SummaryFields inherited from class org.antlr.v4.runtime.DefaultErrorStrategyerrorRecoveryMode, lastErrorIndex, lastErrorStates, nextTokensContext, nextTokensState
- 
Constructor SummaryConstructors Constructor Description DescriptiveErrorStrategy(org.antlr.v4.runtime.CharStream charStream)
- 
Method SummaryModifier and Type Method Description protected java.lang.StringcreateFailedPredicateErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)protected java.lang.StringcreateInputMismatchErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)protected java.lang.StringcreateNoViableAlternativeErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)voidrecover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)org.antlr.v4.runtime.TokenrecoverInline(org.antlr.v4.runtime.Parser recognizer)protected voidreportFailedPredicate(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)protected voidreportInputMismatch(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)protected voidreportNoViableAlternative(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)Methods inherited from class org.antlr.v4.runtime.BailErrorStrategysyncMethods inherited from class org.antlr.v4.runtime.DefaultErrorStrategybeginErrorCondition, constructToken, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, notifyErrorListeners, reportError, reportMatch, reportMissingToken, reportUnwantedToken, reset, singleTokenDeletion, singleTokenInsertionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
DescriptiveErrorStrategypublic DescriptiveErrorStrategy(org.antlr.v4.runtime.CharStream charStream)
 
- 
- 
Method Details- 
recoverpublic void recover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException e)- Specified by:
- recoverin interface- org.antlr.v4.runtime.ANTLRErrorStrategy
- Overrides:
- recoverin class- org.antlr.v4.runtime.BailErrorStrategy
 
- 
recoverInlinepublic org.antlr.v4.runtime.Token recoverInline(org.antlr.v4.runtime.Parser recognizer) throws org.antlr.v4.runtime.RecognitionException- Specified by:
- recoverInlinein interface- org.antlr.v4.runtime.ANTLRErrorStrategy
- Overrides:
- recoverInlinein class- org.antlr.v4.runtime.BailErrorStrategy
- Throws:
- org.antlr.v4.runtime.RecognitionException
 
- 
createNoViableAlternativeErrorMessageprotected java.lang.String createNoViableAlternativeErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)
- 
reportNoViableAlternativeprotected void reportNoViableAlternative(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.NoViableAltException e)- Overrides:
- reportNoViableAlternativein class- org.antlr.v4.runtime.DefaultErrorStrategy
 
- 
createInputMismatchErrorMessageprotected java.lang.String createInputMismatchErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)
- 
reportInputMismatchprotected void reportInputMismatch(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.InputMismatchException e)- Overrides:
- reportInputMismatchin class- org.antlr.v4.runtime.DefaultErrorStrategy
 
- 
createFailedPredicateErrorMessageprotected java.lang.String createFailedPredicateErrorMessage(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)
- 
reportFailedPredicateprotected void reportFailedPredicate(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.FailedPredicateException e)- Overrides:
- reportFailedPredicatein class- org.antlr.v4.runtime.DefaultErrorStrategy
 
 
-