?? sql2.cpp
字號:
/****************************************************************************
* A C A D E M I C C O P Y
*
* This file was produced by an ACADEMIC COPY of Parser Generator. It is for
* use in non-commercial software only. An ACADEMIC COPY of Parser Generator
* can only be used by a student, or a member of an academic community. If
* however you want to use Parser Generator for commercial purposes then you
* will need to purchase a license. For more information see the online help or
* go to the Bumble-Bee Software homepage at:
*
* http://www.bumblebeesoftware.com
*
* This notice must remain present in the file. It cannot be removed.
****************************************************************************/
/****************************************************************************
* sql2.cpp
* C++ source file generated from sql2.y.
*
* Date: 06/06/06
* Time: 22:50:47
*
* AYACC Version: 2.07
****************************************************************************/
#include <yycpars.h>
// namespaces
#ifdef YYSTDCPPLIB
using namespace std;
#endif
#ifdef YYNAMESPACE
using namespace yl;
#endif
// repeated because of possible precompiled header
#include <yycpars.h>
// namespaces
#ifdef YYSTDCPPLIB
using namespace std;
#endif
#ifdef YYNAMESPACE
using namespace yl;
#endif
#include ".\sql2.h"
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#ifndef YYSTACK_SIZE
#define YYSTACK_SIZE 100
#endif
#ifndef YYSTACK_MAX
#define YYSTACK_MAX 0
#endif
/****************************************************************************
* N O T E
*
* If the compiler generates a YYPARSERNAME error then you have not declared
* the name of the parser. The easiest way to do this is to use a name
* declaration. This is placed in the declarations section of your YACC
* source file and is introduced with the %name keyword. For instance, the
* following name declaration declares the parser myparser:
*
* %name myparser
*
* For more information see help.
****************************************************************************/
// yyattribute
#ifdef YYDEBUG
void YYFAR* YYPARSERNAME::yyattribute1(int index) const
{
YYSTYPE YYFAR* p = &((YYSTYPE YYFAR*)yyattributestackptr)[yytop + index];
return p;
}
#define yyattribute(index) (*(YYSTYPE YYFAR*)yyattribute1(index))
#else
#define yyattribute(index) (((YYSTYPE YYFAR*)yyattributestackptr)[yytop + (index)])
#endif
void YYPARSERNAME::yystacktoval(int index)
{
yyassert(index >= 0);
*(YYSTYPE YYFAR*)yyvalptr = ((YYSTYPE YYFAR*)yyattributestackptr)[index];
}
void YYPARSERNAME::yyvaltostack(int index)
{
yyassert(index >= 0);
((YYSTYPE YYFAR*)yyattributestackptr)[index] = *(YYSTYPE YYFAR*)yyvalptr;
}
void YYPARSERNAME::yylvaltoval()
{
*(YYSTYPE YYFAR*)yyvalptr = *(YYSTYPE YYFAR*)yylvalptr;
}
void YYPARSERNAME::yyvaltolval()
{
*(YYSTYPE YYFAR*)yylvalptr = *(YYSTYPE YYFAR*)yyvalptr;
}
void YYPARSERNAME::yylvaltostack(int index)
{
yyassert(index >= 0);
((YYSTYPE YYFAR*)yyattributestackptr)[index] = *(YYSTYPE YYFAR*)yylvalptr;
}
void YYFAR* YYPARSERNAME::yynewattribute(int count)
{
yyassert(count >= 0);
return new YYFAR YYSTYPE[count];
}
void YYPARSERNAME::yydeleteattribute(void YYFAR* attribute)
{
delete[] (YYSTYPE YYFAR*)attribute;
}
void YYPARSERNAME::yycopyattribute(void YYFAR* dest, const void YYFAR* src, int count)
{
for (int i = 0; i < count; i++) {
((YYSTYPE YYFAR*)dest)[i] = ((YYSTYPE YYFAR*)src)[i];
}
}
#ifdef YYDEBUG
void YYPARSERNAME::yyinitdebug(void YYFAR** p, int count) const
{
yyassert(p != NULL);
yyassert(count >= 1);
YYSTYPE YYFAR** p1 = (YYSTYPE YYFAR**)p;
for (int i = 0; i < count; i++) {
p1[i] = &((YYSTYPE YYFAR*)yyattributestackptr)[yytop + i - (count - 1)];
}
}
#endif
void YYPARSERNAME::yyaction(int action)
{
switch (action) {
case 0:
{
#ifdef YYDEBUG
YYSTYPE YYFAR* yya[3];
yyinitdebug((void YYFAR**)yya, 3);
#endif
{
#line 40 ".\\sql2.y"
end_sql();
#line 157 "sql2.cpp"
}
}
break;
case 1:
{
#ifdef YYDEBUG
YYSTYPE YYFAR* yya[4];
yyinitdebug((void YYFAR**)yya, 4);
#endif
{
#line 41 ".\\sql2.y"
end_sql();
#line 170 "sql2.cpp"
}
}
break;
default:
yyassert(0);
break;
}
}
void YYPARSERNAME::yytables()
{
yyattribute_size = sizeof(YYSTYPE);
yysstack_size = YYSTACK_SIZE;
yystack_max = YYSTACK_MAX;
#ifdef YYDEBUG
static const yysymbol_t YYNEARFAR YYBASED_CODE symbol[] = {
{ "$end", 0 },
{ "\'(\'", 40 },
{ "\')\'", 41 },
{ "\'*\'", 42 },
{ "\'+\'", 43 },
{ "\',\'", 44 },
{ "\'-\'", 45 },
{ "\'.\'", 46 },
{ "\'/\'", 47 },
{ "\';\'", 59 },
{ "\'=\'", 61 },
{ "error", 256 },
{ "NAME", 257 },
{ "STRING", 258 },
{ "INTNUM", 259 },
{ "APPROXNUM", 260 },
{ "OR", 261 },
{ "AND", 262 },
{ "NOT", 263 },
{ "COMPARISON", 264 },
{ "UMINUS", 265 },
{ "ALL", 266 },
{ "AMMSC", 267 },
{ "ANY", 268 },
{ "AS", 269 },
{ "ASC", 270 },
{ "AUTHORIZATION", 271 },
{ "BETWEEN", 272 },
{ "BY", 273 },
{ "CHARACTER", 274 },
{ "CHECK", 275 },
{ "CLOSE", 276 },
{ "COMMIT", 277 },
{ "CONTINUE", 278 },
{ "CREATE", 279 },
{ "CURRENT", 280 },
{ "CURSOR", 281 },
{ "DECIMAL", 282 },
{ "DECLARE", 283 },
{ "DEFAULT", 284 },
{ "DELETE", 285 },
{ "DESC", 286 },
{ "DISTINCT", 287 },
{ "DOUBLE", 288 },
{ "ESCAPE", 289 },
{ "EXISTS", 290 },
{ "FETCH", 291 },
{ "FLOAT", 292 },
{ "FOR", 293 },
{ "FOREIGN", 294 },
{ "FOUND", 295 },
{ "FROM", 296 },
{ "GOTO", 297 },
{ "GRANT", 298 },
{ "GROUP", 299 },
{ "HAVING", 300 },
{ "IN", 301 },
{ "INDICATOR", 302 },
{ "INSERT", 303 },
{ "INTEGER", 304 },
{ "INTO", 305 },
{ "IS", 306 },
{ "KEY", 307 },
{ "LIKE", 309 },
{ "NULLX", 310 },
{ "NUMERIC", 311 },
{ "OF", 312 },
{ "ON", 313 },
{ "OPEN", 314 },
{ "OPTION", 315 },
{ "ORDER", 316 },
{ "PARAMETER", 317 },
{ "PRECISION", 318 },
{ "PRIMARY", 319 },
{ "PRIVILEGES", 320 },
{ "PUBLIC", 322 },
{ "REAL", 323 },
{ "REFERENCES", 324 },
{ "ROLLBACK", 325 },
{ "SCHEMA", 326 },
{ "SELECT", 327 },
{ "SET", 328 },
{ "SMALLINT", 329 },
{ "SOME", 330 },
{ "SQLERROR", 332 },
{ "TABLE", 333 },
{ "TO", 334 },
{ "UNION", 335 },
{ "UNIQUE", 336 },
{ "UPDATE", 337 },
{ "USER", 338 },
{ "VALUES", 339 },
{ "VIEW", 340 },
{ "WHENEVER", 341 },
{ "WHERE", 342 },
{ "WITH", 343 },
{ "WORK", 344 },
{ NULL, 0 }
};
yysymbol = symbol;
static const char* const YYNEARFAR YYBASED_CODE rule[] = {
"$accept: sql_list",
"sql_list: sql \';\'",
"sql_list: sql_list sql \';\'",
"sql: schema",
"schema: CREATE SCHEMA AUTHORIZATION user opt_schema_element_list",
"opt_schema_element_list:",
"opt_schema_element_list: schema_element_list",
"schema_element_list: schema_element",
"schema_element_list: schema_element_list schema_element",
"schema_element: base_table_def",
"schema_element: view_def",
"schema_element: privilege_def",
"base_table_def: CREATE TABLE table \'(\' base_table_element_commalist \')\'",
"base_table_element_commalist: base_table_element",
"base_table_element_commalist: base_table_element_commalist \',\' base_table_element",
"base_table_element: column_def",
"base_table_element: table_constraint_def",
"column_def: column data_type column_def_opt_list",
"column_def_opt_list:",
"column_def_opt_list: column_def_opt_list column_def_opt",
"column_def_opt: NOT NULLX",
"column_def_opt: NOT NULLX UNIQUE",
"column_def_opt: NOT NULLX PRIMARY KEY",
"column_def_opt: DEFAULT literal",
"column_def_opt: DEFAULT NULLX",
"column_def_opt: DEFAULT USER",
"column_def_opt: CHECK \'(\' search_condition \')\'",
"column_def_opt: REFERENCES table",
"column_def_opt: REFERENCES table \'(\' column_commalist \')\'",
"table_constraint_def: UNIQUE \'(\' column_commalist \')\'",
"table_constraint_def: PRIMARY KEY \'(\' column_commalist \')\'",
"table_constraint_def: FOREIGN KEY \'(\' column_commalist \')\' REFERENCES table",
"table_constraint_def: FOREIGN KEY \'(\' column_commalist \')\' REFERENCES table \'(\' column_commalist \')\'",
"table_constraint_def: CHECK \'(\' search_condition \')\'",
"column_commalist: column",
"column_commalist: column_commalist \',\' column",
"view_def: CREATE VIEW table opt_column_commalist AS query_spec opt_with_check_option",
"opt_with_check_option:",
"opt_with_check_option: WITH CHECK OPTION",
"opt_column_commalist:",
"opt_column_commalist: \'(\' column_commalist \')\'",
"privilege_def: GRANT privileges ON table TO grantee_commalist opt_with_grant_option",
"opt_with_grant_option:",
"opt_with_grant_option: WITH GRANT OPTION",
"privileges: ALL PRIVILEGES",
"privileges: ALL",
"privileges: operation_commalist",
"operation_commalist: operation",
"operation_commalist: operation_commalist \',\' operation",
"operation: SELECT",
"operation: INSERT",
"operation: DELETE",
"operation: UPDATE opt_column_commalist",
"operation: REFERENCES opt_column_commalist",
"grantee_commalist: grantee",
"grantee_commalist: grantee_commalist \',\' grantee",
"grantee: PUBLIC",
"grantee: user",
"sql: cursor_def",
"cursor_def: DECLARE cursor CURSOR FOR query_exp opt_order_by_clause",
"opt_order_by_clause:",
"opt_order_by_clause: ORDER BY ordering_spec_commalist",
"ordering_spec_commalist: ordering_spec",
"ordering_spec_commalist: ordering_spec_commalist \',\' ordering_spec",
"ordering_spec: INTNUM opt_asc_desc",
"ordering_spec: column_ref opt_asc_desc",
"opt_asc_desc:",
"opt_asc_desc: ASC",
"opt_asc_desc: DESC",
"sql: manipulative_statement",
"manipulative_statement: close_statement",
"manipulative_statement: commit_statement",
"manipulative_statement: delete_statement_positioned",
"manipulative_statement: delete_statement_searched",
"manipulative_statement: fetch_statement",
"manipulative_statement: insert_statement",
"manipulative_statement: open_statement",
"manipulative_statement: rollback_statement",
"manipulative_statement: select_statement",
"manipulative_statement: update_statement_positioned",
"manipulative_statement: update_statement_searched",
"close_statement: CLOSE cursor",
"commit_statement: COMMIT WORK",
"delete_statement_positioned: DELETE FROM table WHERE CURRENT OF cursor",
"delete_statement_searched: DELETE FROM table opt_where_clause",
"fetch_statement: FETCH cursor INTO target_commalist",
"insert_statement: INSERT INTO table opt_column_commalist values_or_query_spec",
"values_or_query_spec: VALUES \'(\' insert_atom_commalist \')\'",
"values_or_query_spec: query_spec",
"insert_atom_commalist: insert_atom",
"insert_atom_commalist: insert_atom_commalist \',\' insert_atom",
"insert_atom: atom",
"insert_atom: NULLX",
"open_statement: OPEN cursor",
"rollback_statement: ROLLBACK WORK",
"select_statement: SELECT opt_all_distinct selection INTO target_commalist table_exp",
"opt_all_distinct:",
"opt_all_distinct: ALL",
"opt_all_distinct: DISTINCT",
"update_statement_positioned: UPDATE table SET assignment_commalist WHERE CURRENT OF cursor",
"assignment_commalist:",
"assignment_commalist: assignment",
"assignment_commalist: assignment_commalist \',\' assignment",
"assignment: column \'=\' scalar_exp",
"assignment: column \'=\' NULLX",
"update_statement_searched: UPDATE table SET assignment_commalist opt_where_clause",
"target_commalist: target",
"target_commalist: target_commalist \',\' target",
"target: parameter_ref",
"opt_where_clause:",
"opt_where_clause: where_clause",
"query_exp: query_term",
"query_exp: query_exp UNION query_term",
"query_exp: query_exp UNION ALL query_term",
"query_term: query_spec",
"query_term: \'(\' query_exp \')\'",
"query_spec: SELECT opt_all_distinct selection table_exp",
"selection: scalar_exp_commalist",
"selection: \'*\'",
"table_exp: from_clause opt_where_clause opt_group_by_clause opt_having_clause",
"from_clause: FROM table_ref_commalist",
"table_ref_commalist: table_ref",
"table_ref_commalist: table_ref_commalist \',\' table_ref",
"table_ref: table",
"table_ref: table range_variable",
"where_clause: WHERE search_condition",
"opt_group_by_clause:",
"opt_group_by_clause: GROUP BY column_ref_commalist",
"column_ref_commalist: column_ref",
"column_ref_commalist: column_ref_commalist \',\' column_ref",
"opt_having_clause:",
"opt_having_clause: HAVING search_condition",
"search_condition:",
"search_condition: search_condition OR search_condition",
"search_condition: search_condition AND search_condition",
"search_condition: NOT search_condition",
"search_condition: \'(\' search_condition \')\'",
"search_condition: predicate",
"predicate: comparison_predicate",
"predicate: between_predicate",
"predicate: like_predicate",
"predicate: test_for_null",
"predicate: in_predicate",
"predicate: all_or_any_predicate",
"predicate: existence_test",
"comparison_predicate: scalar_exp COMPARISON scalar_exp",
"comparison_predicate: scalar_exp COMPARISON subquery",
"between_predicate: scalar_exp NOT BETWEEN scalar_exp AND scalar_exp",
"between_predicate: scalar_exp BETWEEN scalar_exp AND scalar_exp",
"like_predicate: scalar_exp NOT LIKE atom opt_escape",
"like_predicate: scalar_exp LIKE atom opt_escape",
"opt_escape:",
"opt_escape: ESCAPE atom",
"test_for_null: column_ref IS NOT NULLX",
"test_for_null: column_ref IS NULLX",
"in_predicate: scalar_exp NOT IN \'(\' subquery \')\'",
"in_predicate: scalar_exp IN \'(\' subquery \')\'",
"in_predicate: scalar_exp NOT IN \'(\' atom_commalist \')\'",
"in_predicate: scalar_exp IN \'(\' atom_commalist \')\'",
"atom_commalist: atom",
"atom_commalist: atom_commalist \',\' atom",
"all_or_any_predicate: scalar_exp COMPARISON any_all_some subquery",
"any_all_some: ANY",
"any_all_some: ALL",
"any_all_some: SOME",
"existence_test: EXISTS subquery",
"subquery: \'(\' SELECT opt_all_distinct selection table_exp \')\'",
"scalar_exp: scalar_exp \'+\' scalar_exp",
"scalar_exp: scalar_exp \'-\' scalar_exp",
"scalar_exp: scalar_exp \'*\' scalar_exp",
"scalar_exp: scalar_exp \'/\' scalar_exp",
"scalar_exp: \'+\' scalar_exp",
"scalar_exp: \'-\' scalar_exp",
"scalar_exp: atom",
"scalar_exp: column_ref",
"scalar_exp: function_ref",
"scalar_exp: \'(\' scalar_exp \')\'",
"scalar_exp_commalist: scalar_exp",
"scalar_exp_commalist: scalar_exp_commalist \',\' scalar_exp",
"atom: parameter_ref",
"atom: literal",
"atom: USER",
"parameter_ref: parameter",
"parameter_ref: parameter parameter",
"parameter_ref: parameter INDICATOR parameter",
"function_ref: AMMSC \'(\' \'*\' \')\'",
"function_ref: AMMSC \'(\' DISTINCT column_ref \')\'",
"function_ref: AMMSC \'(\' ALL scalar_exp \')\'",
"function_ref: AMMSC \'(\' scalar_exp \')\'",
"literal: STRING",
"literal: INTNUM",
"literal: APPROXNUM",
"table: NAME",
"table: NAME \'.\' NAME",
"column_ref: NAME",
"column_ref: NAME \'.\' NAME",
"column_ref: NAME \'.\' NAME \'.\' NAME",
"data_type: CHARACTER",
"data_type: CHARACTER \'(\' INTNUM \')\'",
"data_type: NUMERIC",
"data_type: NUMERIC \'(\' INTNUM \')\'",
"data_type: NUMERIC \'(\' INTNUM \',\' INTNUM \')\'",
"data_type: DECIMAL",
"data_type: DECIMAL \'(\' INTNUM \')\'",
"data_type: DECIMAL \'(\' INTNUM \',\' INTNUM \')\'",
"data_type: INTEGER",
"data_type: SMALLINT",
"data_type: FLOAT",
"data_type: FLOAT \'(\' INTNUM \')\'",
"data_type: REAL",
"data_type: DOUBLE PRECISION",
"column: NAME",
"cursor: NAME",
"parameter: PARAMETER",
"range_variable: NAME",
"user: NAME",
"sql: WHENEVER NOT FOUND when_action",
"sql: WHENEVER SQLERROR when_action",
"when_action: GOTO NAME",
"when_action: CONTINUE"
};
yyrule = rule;
#endif
static const yyreduction_t YYNEARFAR YYBASED_CODE reduction[] = {
{ 0, 1, -1 },
{ 1, 2, 0 },
{ 1, 3, 1 },
{ 2, 1, -1 },
{ 3, 5, -1 },
{ 4, 0, -1 },
{ 4, 1, -1 },
{ 5, 1, -1 },
{ 5, 2, -1 },
{ 6, 1, -1 },
{ 6, 1, -1 },
{ 6, 1, -1 },
{ 7, 6, -1 },
{ 8, 1, -1 },
{ 8, 3, -1 },
{ 9, 1, -1 },
{ 9, 1, -1 },
{ 10, 3, -1 },
{ 11, 0, -1 },
{ 11, 2, -1 },
{ 12, 2, -1 },
{ 12, 3, -1 },
{ 12, 4, -1 },
{ 12, 2, -1 },
{ 12, 2, -1 },
{ 12, 2, -1 },
{ 12, 4, -1 },
{ 12, 2, -1 },
{ 12, 5, -1 },
{ 13, 4, -1 },
{ 13, 5, -1 },
{ 13, 7, -1 },
{ 13, 10, -1 },
{ 13, 4, -1 },
{ 14, 1, -1 },
{ 14, 3, -1 },
{ 15, 7, -1 },
{ 16, 0, -1 },
{ 16, 3, -1 },
{ 17, 0, -1 },
{ 17, 3, -1 },
{ 18, 7, -1 },
{ 19, 0, -1 },
{ 19, 3, -1 },
{ 20, 2, -1 },
{ 20, 1, -1 },
{ 20, 1, -1 },
{ 21, 1, -1 },
{ 21, 3, -1 },
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -