org.eigenbase.sql.parser
Class SqlParser

java.lang.Object
  extended by org.eigenbase.sql.parser.SqlParser

public class SqlParser
extends Object

A SqlParser parses a SQL statement.

Since:
Mar 18, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/parser/SqlParser.java#17 $
Author:
jhyde

Field Summary
private  String originalInput
           
private  SqlParserImpl parser
           
 
Constructor Summary
SqlParser(Reader reader)
          Creates a SqlParser which reads input from a reader.
SqlParser(String s)
          Creates a SqlParser which reads input from a string.
 
Method Summary
 SqlParserImpl getParserImpl()
          Returns the underlying generated parser.
 SqlNode parseExpression()
          Parses a SQL expression.
 SqlNode parseQuery()
          Parses a SELECT statement.
 SqlNode parseStmt()
          Parses an SQL statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

private final SqlParserImpl parser

originalInput

private String originalInput
Constructor Detail

SqlParser

public SqlParser(String s)
Creates a SqlParser which reads input from a string.


SqlParser

public SqlParser(Reader reader)
Creates a SqlParser which reads input from a reader.

Method Detail

parseExpression

public SqlNode parseExpression()
                        throws SqlParseException
Parses a SQL expression.

Throws:
SqlParseException - if there is a parse error

parseQuery

public SqlNode parseQuery()
                   throws SqlParseException
Parses a SELECT statement.

Returns:
A SqlSelect for a regular SELECT statement; a SqlBinaryOperator for a UNION, INTERSECT, or EXCEPT.
Throws:
SqlParseException - if there is a parse error

parseStmt

public SqlNode parseStmt()
                  throws SqlParseException
Parses an SQL statement.

Returns:
top-level SqlNode representing stmt
Throws:
SqlParseException - if there is a parse error

getParserImpl

public SqlParserImpl getParserImpl()
Returns the underlying generated parser.