Package org.apache.lucene.expressions.js
Class JavascriptParserErrorStrategy
- java.lang.Object
-
- org.antlr.v4.runtime.DefaultErrorStrategy
-
- org.apache.lucene.expressions.js.JavascriptParserErrorStrategy
-
- All Implemented Interfaces:
org.antlr.v4.runtime.ANTLRErrorStrategy
class JavascriptParserErrorStrategy extends org.antlr.v4.runtime.DefaultErrorStrategy
Allows for proper error handling in the ANTLR 4 parser
-
-
Constructor Summary
Constructors Constructor Description JavascriptParserErrorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
recover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException re)
Ensures the ANTLR parser will throw an exception after the first errororg.antlr.v4.runtime.Token
recoverInline(org.antlr.v4.runtime.Parser recognizer)
Ensures the ANTLR parser will throw an exception after the first errorvoid
sync(org.antlr.v4.runtime.Parser recognizer)
Do not allow syncing after errors to ensure the ANTLR parser will throw an exception-
Methods inherited from class org.antlr.v4.runtime.DefaultErrorStrategy
beginErrorCondition, consumeUntil, endErrorCondition, escapeWSAndQuote, getErrorRecoverySet, getExpectedTokens, getMissingSymbol, getSymbolText, getSymbolType, getTokenErrorDisplay, inErrorRecoveryMode, reportError, reportFailedPredicate, reportInputMismatch, reportMatch, reportMissingToken, reportNoViableAlternative, reportUnwantedToken, reset, singleTokenDeletion, singleTokenInsertion
-
-
-
-
Method Detail
-
recover
public void recover(org.antlr.v4.runtime.Parser recognizer, org.antlr.v4.runtime.RecognitionException re)
Ensures the ANTLR parser will throw an exception after the first error- Specified by:
recover
in interfaceorg.antlr.v4.runtime.ANTLRErrorStrategy
- Overrides:
recover
in classorg.antlr.v4.runtime.DefaultErrorStrategy
- Parameters:
recognizer
- the parser being usedre
- the original exception from the parser
-
recoverInline
public org.antlr.v4.runtime.Token recoverInline(org.antlr.v4.runtime.Parser recognizer) throws org.antlr.v4.runtime.RecognitionException
Ensures the ANTLR parser will throw an exception after the first error- Specified by:
recoverInline
in interfaceorg.antlr.v4.runtime.ANTLRErrorStrategy
- Overrides:
recoverInline
in classorg.antlr.v4.runtime.DefaultErrorStrategy
- Parameters:
recognizer
- the parser being used- Returns:
- no actual return value
- Throws:
org.antlr.v4.runtime.RecognitionException
- not used as a ParseException wrapped in a RuntimeException is thrown instead
-
sync
public void sync(org.antlr.v4.runtime.Parser recognizer)
Do not allow syncing after errors to ensure the ANTLR parser will throw an exception- Specified by:
sync
in interfaceorg.antlr.v4.runtime.ANTLRErrorStrategy
- Overrides:
sync
in classorg.antlr.v4.runtime.DefaultErrorStrategy
- Parameters:
recognizer
- the parser being used
-
-