Class ParserImpl
java.lang.Object
org.apache.derby.impl.sql.compile.ParserImpl
- All Implemented Interfaces:
Parser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.derby.impl.sql.compile.SQLParserprivate Objectprivate final CompilerContextprivate CharStream(package private) static final intprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.derby.impl.sql.compile.SQLParsernew parser, appropriate for the ParserImpl object.Returns the current SQL text string that is being parsed.protected ObjectReturns a initialized (clean) TokenManager, paired w. the Parser in getParser, Appropriate for this ParserImpl object.parseSearchCondition(String sqlFragment) Parse an SQL fragment that represents a<search condition>.parseStatement(String statementSQLText) parseStatement(String statementSQLText, Object[] paramDefaults) Parse a statement and return a query tree.private VisitableparseStatementOrSearchCondition(String sql, Object[] paramDefaults, boolean isStatement) Parse a full SQL statement or a fragment that represents a<search condition>.
-
Field Details
-
LARGE_TOKEN_SIZE
static final int LARGE_TOKEN_SIZE- See Also:
-
cachedParser
private org.apache.derby.impl.sql.compile.SQLParser cachedParser -
cachedTokenManager
-
charStream
-
SQLtext
-
cc
-
-
Constructor Details
-
ParserImpl
Constructor for Parser
-
-
Method Details
-
parseStatement
- Specified by:
parseStatementin interfaceParser- Throws:
StandardException
-
getTokenManager
Returns a initialized (clean) TokenManager, paired w. the Parser in getParser, Appropriate for this ParserImpl object. -
getParser
private org.apache.derby.impl.sql.compile.SQLParser getParser()new parser, appropriate for the ParserImpl object. -
parseStatement
public Visitable parseStatement(String statementSQLText, Object[] paramDefaults) throws StandardException Parse a statement and return a query tree. Implements the Parser interface- Specified by:
parseStatementin interfaceParser- Parameters:
statementSQLText- Statement to parseparamDefaults- parameter defaults. Passed around as an array of objects, but is really an array of StorableDataValues- Returns:
- A QueryTree representing the parsed statement
- Throws:
StandardException- Thrown on error
-
parseStatementOrSearchCondition
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- the SQL statement or fragment to parseparamDefaults- parameter defaults to pass on to the parser in the case wheresqlis a full SQL statementisStatement-trueifsqlis a full SQL statement,falseif it is a fragment- Returns:
- parse tree for the SQL
- Throws:
StandardException- if an error happens during parsing
-
parseSearchCondition
Description copied from interface:ParserParse an SQL fragment that represents a<search condition>.- Specified by:
parseSearchConditionin interfaceParser- Parameters:
sqlFragment- the SQL fragment to parse- Returns:
- a parse tree representing the search condition
- Throws:
StandardException- if the SQL fragment could not be parsed
-
getSQLtext
Returns the current SQL text string that is being parsed.- Specified by:
getSQLtextin interfaceParser- Returns:
- Current SQL text string.
-