Class ParserHelper

java.lang.Object
org.drools.drl.parser.lang.ParserHelper

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

  • Constructor Details

    • ParserHelper

      public ParserHelper(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state, LanguageLevelOption languageLevel)
  • Method Details

    • getEditorInterface

      public LinkedList<DroolsSentence> getEditorInterface()
    • 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()
    • beginSentence

      public void beginSentence(DroolsSentenceType sentenceType)
    • getActiveSentence

      public DroolsSentence getActiveSentence()
    • emit

      public void emit(List<?> tokens, DroolsEditorType editorType)
    • emit

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

      public void emit(int activeContext)
    • getLastTokenOnList

      public DroolsToken getLastTokenOnList(LinkedList<?> list)
    • 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)
    • getErrors

      public List<DroolsParserException> getErrors()
      return the raw DroolsParserException errors
    • 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
    • popParaphrases

      public Map<DroolsParaphraseTypes,String> popParaphrases()
    • 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
    • start

      public <T extends DescrBuilder<?, ?>> T start(DescrBuilder<?,?> ctxBuilder, Class<T> clazz, String param)
    • end

      public <T extends DescrBuilder<?, ?>> T end(Class<T> clazz, DescrBuilder<?,?> builder)
    • getStatementKeywords

      public String[] getStatementKeywords()