org.makumba.providers.query
Class Pass1ASTPrinter

java.lang.Object
  extended by org.makumba.providers.query.Pass1ASTPrinter

public class Pass1ASTPrinter
extends Object

Prints a pass1 AST tree back into a query.

Author:
Cristian Bogdan

Nested Class Summary
(package private) static class Pass1ASTPrinter.AssociativeFlatVisitor
          Pulls up an associative operator from (OP a (OP b c)) to (OP (OP a b) c).
 
Constructor Summary
Pass1ASTPrinter()
           
 
Method Summary
static void main(String[] argv)
           
static StringBuffer printAST(antlr.collections.AST tree)
          print a AST pass1 tree back to its "original" HQL query
static boolean testPrinter(antlr.collections.AST f, String query)
          Test method that prints a given AST, re-parses it and compares the initial and final AST
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pass1ASTPrinter

public Pass1ASTPrinter()
Method Detail

printAST

public static StringBuffer printAST(antlr.collections.AST tree)
print a AST pass1 tree back to its "original" HQL query

Parameters:
tree -
Returns:
the HQL query

testPrinter

public static boolean testPrinter(antlr.collections.AST f,
                                  String query)
Test method that prints a given AST, re-parses it and compares the initial and final AST

Parameters:
f - the initial AST
query - the query from which the initial AST came. Used only for debug purposes in case of error
Returns:

main

public static void main(String[] argv)