com.espertech.esper.epl.parse
Class ASTUtil

java.lang.Object
  extended by com.espertech.esper.epl.parse.ASTUtil

public class ASTUtil
extends java.lang.Object

Utility class for AST node handling.


Constructor Summary
ASTUtil()
           
 
Method Summary
static void dumpAST(java.io.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 java.lang.String escapeDot(java.lang.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 java.util.List<java.lang.String> getIdentList(EsperEPL2GrammarParser.ColumnListContext ctx)
           
static java.lang.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, java.util.Set<java.lang.Integer> rulesIds)
           
static boolean isTerminatedOfType(org.antlr.v4.runtime.tree.Tree child, int tokenType)
           
static java.lang.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 java.lang.String unescapeBacktick(java.lang.String text)
           
static java.lang.String unescapeClassIdent(EsperEPL2GrammarParser.ClassIdentifierContext classIdentCtx)
           
static int unescapedIndexOfDot(java.lang.String identifier)
          Find the index of an unescaped dot (.) character, or return -1 if none found.
static java.lang.String unescapeDot(java.lang.String identifierToUnescape)
          Un-Escape all escaped dot characters in the text (identifier only) passed in.
static java.lang.String unescapeSlashIdentifier(EsperEPL2GrammarParser.SlashIdentifierContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTUtil

public ASTUtil()
Method Detail

getIdentList

public static java.util.List<java.lang.String> getIdentList(EsperEPL2GrammarParser.ColumnListContext ctx)

isTerminatedOfType

public static boolean isTerminatedOfType(org.antlr.v4.runtime.tree.Tree child,
                                         int tokenType)

getRuleIndexIfProvided

public static int getRuleIndexIfProvided(org.antlr.v4.runtime.tree.ParseTree tree)

getAssertTerminatedTokenType

public static int getAssertTerminatedTokenType(org.antlr.v4.runtime.tree.ParseTree child)

printNode

public static java.lang.String printNode(org.antlr.v4.runtime.tree.Tree node)

isRecursiveParentRule

public static boolean isRecursiveParentRule(org.antlr.v4.runtime.ParserRuleContext ctx,
                                            java.util.Set<java.lang.Integer> rulesIds)

dumpAST

public static void dumpAST(org.antlr.v4.runtime.tree.Tree ast)
Dump the AST node to system.out.

Parameters:
ast - to dump

dumpAST

public static void dumpAST(java.io.PrintWriter printer,
                           org.antlr.v4.runtime.tree.Tree ast,
                           int ident)

printTokens

public static void printTokens(org.antlr.v4.runtime.CommonTokenStream tokens)
Print the token stream to the logger.

Parameters:
tokens - to print

escapeDot

protected static java.lang.String escapeDot(java.lang.String identifierToEscape)
Escape all unescape dot characters in the text (identifier only) passed in.

Parameters:
identifierToEscape - text to escape
Returns:
text where dots are escaped

unescapedIndexOfDot

public static int unescapedIndexOfDot(java.lang.String identifier)
Find the index of an unescaped dot (.) character, or return -1 if none found.

Parameters:
identifier - text to find an un-escaped dot character
Returns:
index of first unescaped dot

unescapeDot

public static java.lang.String unescapeDot(java.lang.String identifierToUnescape)
Un-Escape all escaped dot characters in the text (identifier only) passed in.

Parameters:
identifierToUnescape - text to un-escape
Returns:
string

getPropertyName

public static java.lang.String getPropertyName(EsperEPL2GrammarParser.EventPropertyContext ctx,
                                               int startNode)

unescapeBacktick

public static java.lang.String unescapeBacktick(java.lang.String text)

unescapeClassIdent

public static java.lang.String unescapeClassIdent(EsperEPL2GrammarParser.ClassIdentifierContext classIdentCtx)

unescapeSlashIdentifier

public static java.lang.String unescapeSlashIdentifier(EsperEPL2GrammarParser.SlashIdentifierContext ctx)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com