org.exolab.castor.jdo.oql
Class Parser

java.lang.Object
  extended by org.exolab.castor.jdo.oql.Parser
All Implemented Interfaces:
TokenTypes

public class Parser
extends java.lang.Object
implements TokenTypes

Generates a parse tree for a stream of tokens representing an OQL query.

Version:
$Revision: 1.4 $ $Date: 2005/11/04 20:48:20 $
Author:
Nissim Karpenstein

Field Summary
(package private)  Token _curToken
           
(package private)  Lexer _lexer
           
(package private)  Token _nextToken
           
(package private)  ParseTreeNode _treeRoot
           
 
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
Parser(Lexer lexer)
          Creates a parser which will generate a parse tree from a series of tokens.
 
Method Summary
 ParseTreeNode getParseTree()
          Generates the parse tree for the tokens provided by the Lexer passed in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_lexer

Lexer _lexer

_curToken

Token _curToken

_nextToken

Token _nextToken

_treeRoot

ParseTreeNode _treeRoot
Constructor Detail

Parser

public Parser(Lexer lexer)
       throws InvalidCharException,
              OQLSyntaxException
Creates a parser which will generate a parse tree from a series of tokens.

Parameters:
lexer - Lexer instance.
Throws:
InvalidCharException - thrown by primeLexer.
OQLSyntaxException - thrown by primeLexer.
Method Detail

getParseTree

public ParseTreeNode getParseTree()
                           throws InvalidCharException,
                                  OQLSyntaxException
Generates the parse tree for the tokens provided by the Lexer passed in the constructor.

Returns:
a ParseTreeNode representing the query.
Throws:
InvalidCharException - thrown by match.
OQLSyntaxException - thrown by match.


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