public class ParseHelper extends Object
Constructor and Description |
---|
ParseHelper() |
Modifier and Type | Method and Description |
---|---|
static 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.
|
public static final String NEWLINE
public static void walk(org.antlr.v4.runtime.tree.Tree ast, EPLTreeWalkerListener listener, String expression, String eplStatementForErrorMsg)
ast
- - ast to walklistener
- - walker instanceexpression
- - the expression we are walking in string formeplStatementForErrorMsg
- - statement text for error messagespublic static ParseResult parse(String expression, String eplStatementErrorMsg, boolean addPleaseCheck, ParseRuleSelector parseRuleSelector, boolean rewriteScript) throws EPException
expression
- - text to parseparseRuleSelector
- - parse rule to selectaddPleaseCheck
- - true to include depth paraphraseeplStatementErrorMsg
- - text for errorrewriteScript
- - whether to rewrite script expressionsEPException
- when the AST could not be parsedpublic static EsperEPL2GrammarLexer newLexer(org.antlr.v4.runtime.CharStream input)
public static EsperEPL2GrammarParser newParser(org.antlr.v4.runtime.CommonTokenStream tokens)
public static boolean hasControlCharacters(String text)