Package org.drools.drl.parser.antlr4
Class DroolsParserExceptionFactory
java.lang.Object
org.drools.drl.parser.antlr4.DroolsParserExceptionFactory
Helper class that generates DroolsParserException with user friendly error
messages.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDroolsParserExceptionFactory(Collection<Map<DroolsParaphraseTypes, String>> paraphrases, LanguageLevelOption languageLevel) DroolsParserErrorMessages constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateDroolsException(Exception e, org.antlr.v4.runtime.Token token) createDroolsException(Object offendingSymbol, int line, int charPositionInLine, String message, org.antlr.v4.runtime.RecognitionException e) This method creates a DroolsParserException full of information.createTrailingSemicolonException(int line, int column, int offset) This method creates a DroolsParserException for trailing semicolon exception, full of information.
-
Field Details
-
TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE
- See Also:
-
PARSER_LOCATION_MESSAGE_COMPLETE
- See Also:
-
PARSER_LOCATION_MESSAGE_PART
- See Also:
-
UNEXPECTED_EXCEPTION
- See Also:
-
-
Constructor Details
-
DroolsParserExceptionFactory
public DroolsParserExceptionFactory(Collection<Map<DroolsParaphraseTypes, String>> paraphrases, LanguageLevelOption languageLevel) DroolsParserErrorMessages constructor.- Parameters:
tokenNames- tokenNames generated by ANTLRparaphrases- paraphrases parser structure
-
-
Method Details
-
createTrailingSemicolonException
This method creates a DroolsParserException for trailing semicolon exception, full of information.- Parameters:
line- line numbercolumn- column positionoffset- char offset- Returns:
- DroolsParserException filled.
-
createDroolsException
public DroolsParserException createDroolsException(Object offendingSymbol, int line, int charPositionInLine, String message, org.antlr.v4.runtime.RecognitionException e) This method creates a DroolsParserException full of information.- Parameters:
offendingSymbol-line-charPositionInLine-e- original exception- Returns:
- DroolsParserException filled.
-
createDroolsException
-