Top Fields Constructors Methods
org.apache.derby.impl.sql.compile

public Class ParserImpl

extends Object
implements Parser
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.compile.Parser
Imports
java.io.StringReader, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.compile.CompilerContext, .Parser, .Visitable

Field Summary

Modifier and TypeField and Description
private SQLParser
private Object
private final CompilerContext
private CharStream
pack-priv static final int
protected String

Constructor Summary

AccessConstructor and Description
public
ParserImpl(CompilerContext cc)

Constructor for Parser

Method Summary

Modifier and TypeMethod and Description
private SQLParser
getParser()

new parser, appropriate for the ParserImpl object.

public String

Returns:

Current SQL text string.
getSQLtext
()

Implements org.apache.derby.iapi.sql.compile.Parser.getSQLtext.

Returns the current SQL text string that is being parsed.

protected Object
getTokenManager()

Returns a initialized (clean) TokenManager, paired w.

public Visitable
parseSearchCondition(String
the SQL fragment to parse
sqlFragment
)

Implements org.apache.derby.iapi.sql.compile.Parser.parseSearchCondition.

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

public Visitable
public Visitable

Returns:

A QueryTree representing the parsed statement
parseStatement
(String
Statement to parse
statementSQLText
,
Object[]
parameter defaults. Passed around as an array of objects, but is really an array of StorableDataValues
paramDefaults
)

Implements org.apache.derby.iapi.sql.compile.Parser.parseStatement.

Parse a statement and return a query tree.

private Visitable

Returns:

parse tree for the SQL
parseStatementOrSearchCondition
(String
the SQL statement or fragment to parse
sql
,
Object[]
parameter defaults to pass on to the parser in the case where sql is a full SQL statement
paramDefaults
,
boolean
true if sql is a full SQL statement, false if it is a fragment
isStatement
)

Parse a full SQL statement or a fragment that represents a <search condition>.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachedParserback to summary
private SQLParser cachedParser
cachedTokenManagerback to summary
private Object cachedTokenManager
ccback to summary
private final CompilerContext cc
charStreamback to summary
private CharStream charStream
LARGE_TOKEN_SIZEback to summary
pack-priv static final int LARGE_TOKEN_SIZE
SQLtextback to summary
protected String SQLtext

Constructor Detail

ParserImplback to summary
public ParserImpl(CompilerContext cc)

Constructor for Parser

Method Detail

getParserback to summary
private SQLParser getParser()

new parser, appropriate for the ParserImpl object.

getSQLtextback to summary
public String getSQLtext()

Implements org.apache.derby.iapi.sql.compile.Parser.getSQLtext.

Returns the current SQL text string that is being parsed.

Returns:String

Current SQL text string.

getTokenManagerback to summary
protected Object getTokenManager()

Returns a initialized (clean) TokenManager, paired w. the Parser in getParser, Appropriate for this ParserImpl object.

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

Implements org.apache.derby.iapi.sql.compile.Parser.parseSearchCondition.

Doc from org.apache.derby.iapi.sql.compile.Parser.parseSearchCondition.

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

Annotations
@Override
Exceptions
StandardException:
if the SQL fragment could not be parsed
parseStatementback to summary
public Visitable parseStatement(String statementSQLText) throws StandardException

Implements org.apache.derby.iapi.sql.compile.Parser.parseStatement.

parseStatementback to summary
public Visitable parseStatement(String statementSQLText, Object[] paramDefaults) throws StandardException

Implements org.apache.derby.iapi.sql.compile.Parser.parseStatement.

Parse a statement and return a query tree. Implements the Parser interface

Parameters
statementSQLText:String

Statement to parse

paramDefaults:Object[]

parameter defaults. Passed around as an array of objects, but is really an array of StorableDataValues

Returns:Visitable

A QueryTree representing the parsed statement

Exceptions
StandardException:
Thrown on error
parseStatementOrSearchConditionback to summary
private Visitable parseStatementOrSearchCondition(String sql, Object[] paramDefaults, boolean isStatement) throws StandardException

Parse a full SQL statement or a fragment that represents a <search condition>.

Parameters
sql:String

the SQL statement or fragment to parse

paramDefaults:Object[]

parameter defaults to pass on to the parser in the case where sql is a full SQL statement

isStatement:boolean

true if sql is a full SQL statement, false if it is a fragment

Returns:Visitable

parse tree for the SQL

Exceptions
StandardException:
if an error happens during parsing