Package org.drools.drl.parser.lang
Class ParserHelper
java.lang.Object
org.drools.drl.parser.lang.ParserHelper
This is a class to hold all the helper functions/methods used
by the DRL parser
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParserHelper(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state, LanguageLevelOption languageLevel) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginSentence(DroolsSentenceType sentenceType) voidvoidemit(int activeContext) voidemit(List<?> tokens, DroolsEditorType editorType) voidemit(org.antlr.runtime.Token token, DroolsEditorType editorType) void<T extends DescrBuilder<?,?>>
Tend(Class<T> clazz, DescrBuilder<?, ?> builder) Return a list of pretty strings summarising the errorsreturn the raw DroolsParserException errorsbooleangetLastTokenOnList(LinkedList<?> list) String[]booleanreturn true if any parser errors were accumulatedbooleanisPluggableEvaluator(boolean negated) booleanisPluggableEvaluator(int offset, boolean negated) static voidlogAgendaGroupWarn(AttributeDescr attributeDescr) static voidlogAnnotationInLhsPatternWarn(CEDescrBuilder descrBuilder) static voidlogCustomOperatorWarn(org.antlr.runtime.Token token) static voidlogHalfConstraintWarn(String message) static voidlogHalfConstraintWarn(String logicalConstraint, BaseDescr descr) static voidlogInfixAndWarn(CEDescrBuilder descrBuilder) static voidlogInfixOrWarn(CEDescrBuilder descrBuilder) voidMethod that adds a paraphrase type into paraphrases stack.voidvoidreportError(org.antlr.runtime.RecognitionException ex) retrieveLT(int LTNumber) voidsetHasOperator(boolean hasOperator) voidsetLeftMostExpr(String value) voidsetParaphrasesValue(DroolsParaphraseTypes type, String value) Method that sets paraphrase value for a type into paraphrases stack.<T extends DescrBuilder<?,?>>
Tstart(DescrBuilder<?, ?> ctxBuilder, Class<T> clazz, String param) booleanvalidateAttribute(int index) booleanvalidateCEKeyword(int index) booleanvalidateIdentifierKey(String text) booleanvalidateLT(int LTNumber, String text) booleanvalidateStatement(int index)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
statementKeywords
-
errors
-
editorInterface
-
isEditorInterfaceEnabled
public boolean isEditorInterfaceEnabled
-
-
Constructor Details
-
Method Details
-
getEditorInterface
-
setLeftMostExpr
-
getLeftMostExpr
-
enableEditorInterface
public void enableEditorInterface() -
disableEditorInterface
public void disableEditorInterface() -
setHasOperator
public void setHasOperator(boolean hasOperator) -
getHasOperator
public boolean getHasOperator() -
beginSentence
-
getActiveSentence
-
emit
-
emit
-
emit
public void emit(int activeContext) -
getLastTokenOnList
-
retrieveLT
-
validateLT
-
isPluggableEvaluator
public boolean isPluggableEvaluator(int offset, boolean negated) -
isPluggableEvaluator
public boolean isPluggableEvaluator(boolean negated) -
validateIdentifierKey
-
validateCEKeyword
public boolean validateCEKeyword(int index) -
validateStatement
public boolean validateStatement(int index) -
validateAttribute
public boolean validateAttribute(int index) -
reportError
public void reportError(org.antlr.runtime.RecognitionException ex) -
reportError
-
getErrors
return the raw DroolsParserException errors -
getErrorMessages
Return a list of pretty strings summarising the errors -
hasErrors
public boolean hasErrors()return true if any parser errors were accumulated -
pushParaphrases
Method that adds a paraphrase type into paraphrases stack.- Parameters:
type- paraphrase type
-
popParaphrases
-
setParaphrasesValue
Method that sets paraphrase value for a type into paraphrases stack.- Parameters:
type- paraphrase typevalue- paraphrase value
-
start
public <T extends DescrBuilder<?,?>> T start(DescrBuilder<?, ?> ctxBuilder, Class<T> clazz, String param) -
end
-
getStatementKeywords
-
logHalfConstraintWarn
-
logHalfConstraintWarn
-
logCustomOperatorWarn
public static void logCustomOperatorWarn(org.antlr.runtime.Token token) -
logInfixOrWarn
-
logInfixAndWarn
-
logAnnotationInLhsPatternWarn
-
logAgendaGroupWarn
-