com.espertech.esper.antlr
Class ASTUtil

java.lang.Object
  extended by com.espertech.esper.antlr.ASTUtil

public class ASTUtil
extends java.lang.Object

Utility class for AST node handling.


Constructor Summary
ASTUtil()
           
 
Method Summary
static void dumpAST(org.antlr.runtime.tree.Tree ast)
          Dump the AST node to system.out.
static java.util.List<org.antlr.runtime.tree.Tree> findAllNodes(org.antlr.runtime.tree.Tree parent, int type)
           
static org.antlr.runtime.tree.Tree findFirstNode(org.antlr.runtime.tree.Tree parent, int type)
          Returns the first child node (shallow search) of the given parent that matches type, or null if no child node matches type.
static void printTokens(org.antlr.runtime.CommonTokenStream tokens)
          Print the token stream to the logger.
 
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

findFirstNode

public static org.antlr.runtime.tree.Tree findFirstNode(org.antlr.runtime.tree.Tree parent,
                                                        int type)
Returns the first child node (shallow search) of the given parent that matches type, or null if no child node matches type.

Parameters:
parent - whose child nodes to ask for type
type - the type looked for
Returns:
child node if found, or null if not found

findAllNodes

public static java.util.List<org.antlr.runtime.tree.Tree> findAllNodes(org.antlr.runtime.tree.Tree parent,
                                                                       int type)

dumpAST

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

Parameters:
ast - to dump

printTokens

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

Parameters:
tokens - to print

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