public class ASTUtil extends Object
Constructor and Description |
---|
ASTUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
dumpAST(PrintWriter printer,
org.antlr.v4.runtime.tree.Tree ast,
int ident) |
static void |
dumpAST(org.antlr.v4.runtime.tree.Tree ast)
Dump the AST node to system.out.
|
protected static String |
escapeDot(String identifierToEscape)
Escape all unescape dot characters in the text (identifier only) passed in.
|
static int |
getAssertTerminatedTokenType(org.antlr.v4.runtime.tree.ParseTree child) |
static List<String> |
getIdentList(EsperEPL2GrammarParser.ColumnListContext ctx) |
static String |
getPropertyName(EsperEPL2GrammarParser.EventPropertyContext ctx,
int startNode) |
static int |
getRuleIndexIfProvided(org.antlr.v4.runtime.tree.ParseTree tree) |
static boolean |
isRecursiveParentRule(org.antlr.v4.runtime.ParserRuleContext ctx,
Set<Integer> rulesIds) |
static boolean |
isTerminatedOfType(org.antlr.v4.runtime.tree.Tree child,
int tokenType) |
static String |
printNode(org.antlr.v4.runtime.tree.Tree node) |
static void |
printTokens(org.antlr.v4.runtime.CommonTokenStream tokens)
Print the token stream to the logger.
|
static String |
unescapeBacktick(String text) |
static String |
unescapeClassIdent(EsperEPL2GrammarParser.ClassIdentifierContext classIdentCtx) |
static int |
unescapedIndexOfDot(String identifier)
Find the index of an unescaped dot (.) character, or return -1 if none found.
|
static String |
unescapeDot(String identifierToUnescape)
Un-Escape all escaped dot characters in the text (identifier only) passed in.
|
static String |
unescapeSlashIdentifier(EsperEPL2GrammarParser.SlashIdentifierContext ctx) |
public static List<String> getIdentList(EsperEPL2GrammarParser.ColumnListContext ctx)
public static boolean isTerminatedOfType(org.antlr.v4.runtime.tree.Tree child, int tokenType)
public static int getRuleIndexIfProvided(org.antlr.v4.runtime.tree.ParseTree tree)
public static int getAssertTerminatedTokenType(org.antlr.v4.runtime.tree.ParseTree child)
public static String printNode(org.antlr.v4.runtime.tree.Tree node)
public static boolean isRecursiveParentRule(org.antlr.v4.runtime.ParserRuleContext ctx, Set<Integer> rulesIds)
public static void dumpAST(org.antlr.v4.runtime.tree.Tree ast)
ast
- to dumppublic static void dumpAST(PrintWriter printer, org.antlr.v4.runtime.tree.Tree ast, int ident)
public static void printTokens(org.antlr.v4.runtime.CommonTokenStream tokens)
tokens
- to printprotected static String escapeDot(String identifierToEscape)
identifierToEscape
- text to escapepublic static int unescapedIndexOfDot(String identifier)
identifier
- text to find an un-escaped dot characterpublic static String unescapeDot(String identifierToUnescape)
identifierToUnescape
- text to un-escapepublic static String getPropertyName(EsperEPL2GrammarParser.EventPropertyContext ctx, int startNode)
public static String unescapeClassIdent(EsperEPL2GrammarParser.ClassIdentifierContext classIdentCtx)
public static String unescapeSlashIdentifier(EsperEPL2GrammarParser.SlashIdentifierContext ctx)