org.exolab.castor.jdo.oql
Class ParseTest

java.lang.Object
  extended byorg.exolab.castor.jdo.oql.ParseTest
All Implemented Interfaces:
TokenTypes

public class ParseTest
extends java.lang.Object
implements TokenTypes

Test class for Parser.

Version:
$Revision: 1.3 $ $Date: 2004/10/29 15:43:27 $
Author:
Nissim Karpenstein

Field Summary
static int NODE_TYPES
           
static int NODE_VALUES
           
 
Fields inherited from interface org.exolab.castor.jdo.oql.TokenTypes
ARROW, BOOLEAN_LITERAL, CHAR_LITERAL, COLON, COMMA, CONCAT, DATE_LITERAL, DIVIDE, DOLLAR, DOT, DOUBLE_LITERAL, END_OF_QUERY, EQUAL, GT, GTE, IDENTIFIER, KEYWORD_ABS, KEYWORD_AND, KEYWORD_AS, KEYWORD_ASC, KEYWORD_AVG, KEYWORD_BETWEEN, KEYWORD_BY, KEYWORD_COUNT, KEYWORD_DESC, KEYWORD_DISTINCT, KEYWORD_FROM, KEYWORD_IN, KEYWORD_IS_DEFINED, KEYWORD_IS_UNDEFINED, KEYWORD_LIKE, KEYWORD_LIMIT, KEYWORD_LIST, KEYWORD_MAX, KEYWORD_MIN, KEYWORD_MOD, KEYWORD_NIL, KEYWORD_NOT, KEYWORD_OFFSET, KEYWORD_OR, KEYWORD_ORDER, KEYWORD_SELECT, KEYWORD_SUM, KEYWORD_UNDEFINED, KEYWORD_WHERE, LONG_LITERAL, LPAREN, LT, LTE, MINUS, NOT_EQUAL, PLUS, RPAREN, STRING_LITERAL, TIME_LITERAL, TIMES, TIMESTAMP_LITERAL
 
Constructor Summary
ParseTest()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main function.
static java.lang.String treeToString(ParseTreeNode theTree, int printWhat)
          Returns a string representation of the tree using lisp tree notation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_TYPES

public static final int NODE_TYPES
See Also:
Constant Field Values

NODE_VALUES

public static final int NODE_VALUES
See Also:
Constant Field Values
Constructor Detail

ParseTest

public ParseTest()
Method Detail

main

public static void main(java.lang.String[] args)
Main function. Takes OQL query string as command line parameter and prints Parse Tree version of that query to stdout.

Parameters:
args - Pass an OQL query string on the command line.

treeToString

public static java.lang.String treeToString(ParseTreeNode theTree,
                                            int printWhat)
Returns a string representation of the tree using lisp tree notation. (A, B, C, D) means a root a with children B, C, and D. (A, (B, C, D), E) means A with a child B who has children C and D, and another child E (of A).

Parameters:
theTree - the Tree to convert to a string
printWhat - should be one of the static members NODE_TYPES or NODE_VALUES to tell the method what to write in the string.
Returns:
a string as described above.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com