| java.lang.Object org.hsqldb.Parser
Parser | class Parser (Code) | | Responsible for parsing non-DDL statements.
Extensively rewritten and extended in successive versions of HSQLDB.
author: Thomas Mueller (Hypersonic SQL Group) version: 1.8.0 since: Hypersonic SQL |
Method Summary | |
int | addFilterColumns(TableFilter filter, HsqlArrayList columnList, int position) | void | checkTableWriteAccess(Table table, int userRight) Tests whether the parsing session has the given write access on the
given Table object. | void | clearParameters() | CompiledStatement | compileCallStatement() Retrieves a CALL-type CompiledStatement from this parse context. | CompiledStatement | compileDeleteStatement() Retrieves a DELETE-type CompiledStatement from this parse context. | CompiledStatement | compileInsertStatement() Retrieves an INSERT_XXX-type CompiledStatement from this parse context. | CompiledStatement | compileSelectStatement(int brackets) Retrieves a SELECT-type CompiledStatement from this parse context. | CompiledStatement | compileUpdateStatement() Retrieves an UPDATE-type CompiledStatement from this parse context. | static HsqlArrayList | getColumnNames(Database db, Table table, Tokenizer t, boolean full) Parses a comma-separated, right-bracket terminated list of column
names. | Expression[] | getParameters() | SubQuery[] | getSortedSubqueries() | SubQuery | getViewSubquery(View v) | boolean | isCompilingView() | int | parseCloseBrackets(int limit) | HashMappedList | parseColumnList() | Expression | parseExpression() | int | parseOpenBrackets() | int | parseOpenBracketsSelect() | Select | parseSelect(int brackets, boolean canHaveOrder, boolean canHaveLimit, boolean limitWithOrder, boolean isMain) Constructs and returns a Select object. | SubQuery | parseSubquery(int brackets, HsqlName[] colNames, boolean resolveAll, int predicateType) The SubQuery objects are added to the end of subquery list. | int | parseUnion(String token) Parses the given token and any further tokens in tokenizer to return
any UNION or other set operation ID. | static HashMappedList | processColumnList(Tokenizer tokenizer, boolean acceptAscDesc) | Expression | readCaseExpression() reads a CASE .. | Expression | readDefaultClause(int dataType) Reads a DEFAULT clause expression. | void | reset(String sql) Resets this parse context with the given SQL character sequence. | void | setAsView(View view) | void | setCompilingView() |
Parser | Parser(Session session, Database db, Tokenizer t)(Code) | | Constructs a new Parser object with the given context.
Parameters: db - the Database instance against which to resolve nameddatabase object references Parameters: t - the token source from which to parse commands Parameters: session - the connected context |
checkTableWriteAccess | void checkTableWriteAccess(Table table, int userRight) throws HsqlException(Code) | | Tests whether the parsing session has the given write access on the
given Table object.
Parameters: table - the Table object to check Parameters: userRight - the numeric code of the right to check throws: HsqlException - if the session user does not have the rightor the given Table object is simply not writable (e.g. is anon-updateable View) |
clearParameters | void clearParameters()(Code) | | |
getColumnNames | static HsqlArrayList getColumnNames(Database db, Table table, Tokenizer t, boolean full) throws HsqlException(Code) | | Parses a comma-separated, right-bracket terminated list of column
names.
Parameters: db - the Database instance whose name manager is to provide theresulting HsqlName objects, when the full argument is true Parameters: t - the tokenizer representing the character sequence to be parsed Parameters: full - if true, generate a list of HsqlNames, else a list ofString objects |
getSortedSubqueries | SubQuery[] getSortedSubqueries()(Code) | | Return the list of subqueries as an array sorted according to the order
of materialization, then clear the internal subquery list
|
isCompilingView | boolean isCompilingView()(Code) | | determines whether the parser is used for compiling a view
|
parseSelect | Select parseSelect(int brackets, boolean canHaveOrder, boolean canHaveLimit, boolean limitWithOrder, boolean isMain) throws HsqlException(Code) | | Constructs and returns a Select object.
Parameters: canHaveOrder - whether the SELECT being parsed can have an ORDER BY Parameters: canHaveLimit - whether LIMIT without ORDER BY is allowed Parameters: limitWithOrder - whether LIMIT is allowed only with ORDER BY Parameters: isMain - whether the SELECT being parsed is the firstselect statement in the set a new Select object throws: HsqlException - if a parsing error occurs |
parseSubquery | SubQuery parseSubquery(int brackets, HsqlName[] colNames, boolean resolveAll, int predicateType) throws HsqlException(Code) | | The SubQuery objects are added to the end of subquery list.
When parsing the SELECT for a view, optional HsqlName[] array is used
for view column aliases.
|
parseUnion | int parseUnion(String token) throws HsqlException(Code) | | Parses the given token and any further tokens in tokenizer to return
any UNION or other set operation ID.
|
reset | void reset(String sql)(Code) | | Resets this parse context with the given SQL character sequence.
Internal structures are reset as though a new parser were created
with the given sql and the originally specified database and session
Parameters: a - new SQL character sequence to replace the current one |
setAsView | void setAsView(View view)(Code) | | Sets the subqueries as belonging to the View being constructed
|
setCompilingView | void setCompilingView()(Code) | | sets a flag indicating the parser is used for compiling a view
|
|
|