Top Description Methods
org.apache.derby.iapi.sql.compile

public Interface Parser

Known Direct Implementers
org.apache.derby.impl.sql.compile.ParserImpl
Imports
org.apache.derby.shared.common.error.StandardException

The Parser interface is intended to work with Jack-generated parsers (now JavaCC). We will specify "STATIC=false" when building Jack parsers - this specifies that the generated classes will not be static, which will allow there to be more than one parser (this is necessary in a multi-threaded server). Non-static parsers do not have to be re-initialized every time they are used (unlike static parsers, for which one must call ReInit() between calls to the parser).

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Current SQL text string.
getSQLtext
()

Returns the current SQL text string that is being parsed.

public Visitable

Returns:

a parse tree representing the search condition
parseSearchCondition
(String
the SQL fragment to parse
sqlFragment
)

Parse an SQL fragment that represents a <search condition>.

public Visitable

Returns:

A new QueryTree representing the syntax of the Statement
parseStatement
(String
The Statement to parse.
statementSQLText
,
Object[]
Parameter defaults
paramDefaults
)

Parses the given statement and returns a query tree.

public Visitable
parseStatement(String statementSQLText)

Method Detail

getSQLtextback to summary
public String getSQLtext()

Returns the current SQL text string that is being parsed.

Returns:String

Current SQL text string.

parseSearchConditionback to summary
public Visitable parseSearchCondition(String sqlFragment) throws StandardException

Parse an SQL fragment that represents a <search condition>.

Parameters
sqlFragment:String

the SQL fragment to parse

Returns:Visitable

a parse tree representing the search condition

Exceptions
StandardException:
if the SQL fragment could not be parsed
parseStatementback to summary
public Visitable parseStatement(String statementSQLText, Object[] paramDefaults) throws StandardException

Parses the given statement and returns a query tree. The query tree at this point is a simple syntactic translation of the statement. No binding will have taken place, and no decisions will have been made regarding processing strategy.

Parameters
statementSQLText:String

The Statement to parse.

paramDefaults:Object[]

Parameter defaults

Returns:Visitable

A new QueryTree representing the syntax of the Statement

Exceptions
StandardException:
Thrown on failure
parseStatementback to summary
public Visitable parseStatement(String statementSQLText) throws StandardException