Class ParseHelper
java.lang.Object
com.espertech.esper.compiler.internal.parse.ParseHelper
Helper class for parsing an expression and walking a parse tree.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
hasControlCharacters
(String text) static EsperEPL2GrammarLexer
newLexer
(org.antlr.v4.runtime.CharStream input) static EsperEPL2GrammarParser
newParser
(org.antlr.v4.runtime.CommonTokenStream tokens) static ParseResult
parse
(String expression, String eplStatementErrorMsg, boolean addPleaseCheck, ParseRuleSelector parseRuleSelector, boolean rewriteScript) Parse expression using the rule the ParseRuleSelector instance supplies.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.
-
Field Details
-
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 walklistener
- - walker instanceexpression
- - the expression we are walking in string formeplStatementForErrorMsg
- - 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 parseparseRuleSelector
- - parse rule to selectaddPleaseCheck
- - true to include depth paraphraseeplStatementErrorMsg
- - text for errorrewriteScript
- - whether to rewrite script expressions- Returns:
- AST - syntax tree
- Throws:
com.espertech.esper.common.client.EPException
- when the AST could not be parsedcom.espertech.esper.common.internal.compile.stage2.StatementSpecCompileSyntaxException
- syntax exceptions
-
newLexer
-
newParser
-
hasControlCharacters
-