Class ParserHelper


  • public class ParserHelper
    extends Object
    This is a class to hold all the helper functions/methods used by the DRL parser
    • Constructor Detail

      • ParserHelper

        public ParserHelper​(org.antlr.runtime.TokenStream input,
                            org.antlr.runtime.RecognizerSharedState state,
                            org.kie.internal.builder.conf.LanguageLevelOption languageLevel)
    • Method Detail

      • setLeftMostExpr

        public void setLeftMostExpr​(String value)
      • getLeftMostExpr

        public String getLeftMostExpr()
      • enableEditorInterface

        public void enableEditorInterface()
      • disableEditorInterface

        public void disableEditorInterface()
      • setHasOperator

        public void setHasOperator​(boolean hasOperator)
      • getHasOperator

        public boolean getHasOperator()
      • emit

        public void emit​(org.antlr.runtime.Token token,
                         DroolsEditorType editorType)
      • emit

        public void emit​(int activeContext)
      • retrieveLT

        public String retrieveLT​(int LTNumber)
      • validateLT

        public boolean validateLT​(int LTNumber,
                                  String text)
      • isPluggableEvaluator

        public boolean isPluggableEvaluator​(int offset,
                                            boolean negated)
      • isPluggableEvaluator

        public boolean isPluggableEvaluator​(boolean negated)
      • validateIdentifierKey

        public boolean validateIdentifierKey​(String text)
      • 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

        public void reportError​(Exception e)
      • getErrorMessages

        public List<String> getErrorMessages()
        Return a list of pretty strings summarising the errors
      • hasErrors

        public boolean hasErrors()
        return true if any parser errors were accumulated
      • pushParaphrases

        public void pushParaphrases​(DroolsParaphraseTypes type)
        Method that adds a paraphrase type into paraphrases stack.
        Parameters:
        type - paraphrase type
      • setParaphrasesValue

        public void setParaphrasesValue​(DroolsParaphraseTypes type,
                                        String value)
        Method that sets paraphrase value for a type into paraphrases stack.
        Parameters:
        type - paraphrase type
        value - paraphrase value
      • getStatementKeywords

        public String[] getStatementKeywords()