Class ParseHelper

java.lang.Object
com.espertech.esper.compiler.internal.parse.ParseHelper

public class ParseHelper extends Object
Helper class for parsing an expression and walking a parse tree.
  • Field Details

    • NEWLINE

      public static final String NEWLINE
      Newline.
  • Constructor Details

    • ParseHelper

      public ParseHelper()
  • Method Details

    • walk

      public static void walk(org.antlr.v4.runtime.tree.Tree ast, EPLTreeWalkerListener listener, String expression, String eplStatementForErrorMsg)
      Walk parse tree starting at the rule the walkRuleSelector supplies.
      Parameters:
      ast - - ast to walk
      listener - - walker instance
      expression - - the expression we are walking in string form
      eplStatementForErrorMsg - - statement text for error messages
    • parse

      public static ParseResult parse(String expression, String eplStatementErrorMsg, boolean addPleaseCheck, ParseRuleSelector parseRuleSelector, boolean rewriteScript) throws com.espertech.esper.common.internal.compile.stage2.StatementSpecCompileSyntaxException
      Parse expression using the rule the ParseRuleSelector instance supplies.
      Parameters:
      expression - - text to parse
      parseRuleSelector - - parse rule to select
      addPleaseCheck - - true to include depth paraphrase
      eplStatementErrorMsg - - text for error
      rewriteScript - - whether to rewrite script expressions
      Returns:
      AST - syntax tree
      Throws:
      com.espertech.esper.common.client.EPException - when the AST could not be parsed
      com.espertech.esper.common.internal.compile.stage2.StatementSpecCompileSyntaxException - syntax exceptions
    • newLexer

      public static EsperEPL2GrammarLexer newLexer(org.antlr.v4.runtime.CharStream input)
    • newParser

      public static EsperEPL2GrammarParser newParser(org.antlr.v4.runtime.CommonTokenStream tokens)
    • hasControlCharacters

      public static boolean hasControlCharacters(String text)