Commit a0553ca9 authored by osku's avatar osku

Support user-function callbacks for processing results of FETCH statements

in InnoDB's SQL parser.
parent c56a927e
......@@ -1229,7 +1229,7 @@ dict_create_or_check_foreign_constraint_tables(void)
"COMMIT WORK;\n"
"END;\n";
graph = pars_sql(str);
graph = pars_sql(NULL, str);
ut_a(graph);
......@@ -1403,7 +1403,7 @@ loop:
ut_a(sqlend == sql + len + 1);
graph = pars_sql(sql);
graph = pars_sql(NULL, sql);
ut_a(graph);
......
......@@ -116,7 +116,8 @@
PARS_WORK_TOKEN = 342,
PARS_UNSIGNED_TOKEN = 343,
PARS_EXIT_TOKEN = 344,
NEG = 345
PARS_FUNCTION_TOKEN = 345,
NEG = 346
};
#endif
#define PARS_INT_LIT 258
......@@ -206,7 +207,8 @@
#define PARS_WORK_TOKEN 342
#define PARS_UNSIGNED_TOKEN 343
#define PARS_EXIT_TOKEN 344
#define NEG 345
#define PARS_FUNCTION_TOKEN 345
#define NEG 346
......
......@@ -77,6 +77,7 @@ que_t*
pars_sql(
/*=====*/
/* out, own: the query graph */
pars_info_t* info, /* in: extra information, or NULL */
const char* str); /* in: SQL string */
/*****************************************************************
Retrieves characters to the lexical analyzer. */
......@@ -157,6 +158,15 @@ pars_cursor_declaration(
table */
sel_node_t* select_node); /* in: select node */
/*************************************************************************
Parses a function declaration. */
que_node_t*
pars_function_declaration(
/*======================*/
/* out: sym_node */
sym_node_t* sym_node); /* in: function id node in the symbol
table */
/*************************************************************************
Parses a select statement. */
sel_node_t*
......@@ -301,14 +311,16 @@ pars_assignment_statement(
sym_node_t* var, /* in: variable to assign */
que_node_t* val); /* in: value to assign */
/*************************************************************************
Parses a fetch statement. */
Parses a fetch statement. into_list or user_func (but not both) must be
non-NULL. */
fetch_node_t*
pars_fetch_statement(
/*=================*/
/* out: fetch statement node */
sym_node_t* cursor, /* in: cursor node */
sym_node_t* into_list); /* in: variables to set */
sym_node_t* into_list, /* in: variables to set, or NULL */
sym_node_t* user_func); /* in: user function name, or NULL */
/*************************************************************************
Parses an open or close cursor statement. */
......@@ -427,6 +439,39 @@ pars_complete_graph_for_exec(
trx_t* trx, /* in: transaction handle */
mem_heap_t* heap); /* in: memory heap from which allocated */
/********************************************************************
Get user function with the given name.*/
pars_user_func_t*
pars_info_get_user_func(
/*====================*/
/* out: user func, or NULL if not
found */
pars_info_t* info, /* in: info struct */
const char* name); /* in: function name to find*/
/* Extra information (possibly) supplied for pars_sql(). */
struct pars_info_struct {
pars_user_func_t* funcs; /* User functions, owned by
the user, who's responsible
for freeing them as
necessary. */
ulint n_funcs; /* number of user functions */
};
/* Type of the user functions. The first argument is always InnoDB-supplied
and varies in type, while 'user_arg' is a user-supplied argument. The
meaning of the return type also varies. See the individual use cases, e.g.
the FETCH statement, for details on them. */
typedef void* (*pars_user_func_cb_t)(void* arg, void* user_arg);
/* User-supplied function and argument. */
struct pars_user_func_struct {
const char* name; /* function name */
pars_user_func_cb_t func; /* function address */
void* arg; /* user-supplied argument */
};
/* Struct used to denote a reserved word in a parsing tree */
struct pars_res_word_struct{
......
......@@ -158,6 +158,7 @@ struct sym_tab_struct{
/* position of the next character in
sql_string to give to the lexical
analyzer */
pars_info_t* info; /* extra information, or NULL */
sym_node_list_t sym_list;
/* list of symbol nodes in the symbol
table */
......@@ -180,6 +181,7 @@ struct sym_tab_struct{
#define SYM_CURSOR 96 /* named cursor */
#define SYM_PROCEDURE_NAME 97 /* stored procedure name */
#define SYM_INDEX 98 /* database index name */
#define SYM_FUNCTION 99 /* user function name */
#ifndef UNIV_NONINL
#include "pars0sym.ic"
......
......@@ -9,6 +9,8 @@ Created 1/11/1998 Heikki Tuuri
#ifndef pars0types_h
#define pars0types_h
typedef struct pars_info_struct pars_info_t;
typedef struct pars_user_func_struct pars_user_func_t;
typedef struct sym_node_struct sym_node_t;
typedef struct sym_tab_struct sym_tab_t;
typedef struct pars_res_word_struct pars_res_word_t;
......
......@@ -78,6 +78,15 @@ fetch_step(
/*=======*/
/* out: query thread to run next or NULL */
que_thr_t* thr); /* in: query thread */
/********************************************************************
Sample callback function for fetch that prints each row.*/
void*
row_fetch_print(
/*============*/
/* out: always returns non-NULL */
void* row, /* in: sel_node_t* */
void* user_arg); /* in: not used */
/***************************************************************
Prints a row in a select result. */
......@@ -311,6 +320,20 @@ struct fetch_node_struct{
que_common_t common; /* type: QUE_NODE_FETCH */
sel_node_t* cursor_def; /* cursor definition */
sym_node_t* into_list; /* variables to set */
pars_user_func_t*
func; /* User callback function or NULL.
The first argument to the function
is a sel_node_t*, containing the
results of the SELECT operation for
one row. If the function returns
NULL, it is not interested in
further rows and the cursor is
modified so (cursor % NOTFOUND) is
true. If it returns not-NULL,
continue normally. See
row_fetch_print() for an example
(and a useful debugging tool). */
};
/* Open or close cursor statement node */
......
......@@ -356,8 +356,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 114
#define YY_END_OF_BUFFER 115
#define YY_NUM_RULES 115
#define YY_END_OF_BUFFER 116
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
......@@ -365,50 +365,52 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[386] =
static yyconst flex_int16_t yy_accept[393] =
{ 0,
0, 0, 109, 109, 0, 0, 0, 0, 115, 113,
112, 112, 6, 104, 3, 93, 99, 102, 100, 97,
101, 113, 103, 1, 113, 98, 96, 94, 95, 107,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 105, 106,
109, 110, 4, 5, 7, 8, 112, 88, 108, 2,
1, 89, 90, 92, 91, 87, 87, 87, 87, 87,
87, 43, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 26, 15, 23,
87, 87, 87, 87, 53, 60, 87, 12, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 109, 110, 110, 111, 4,
5, 7, 8, 2, 11, 44, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 25, 87, 87, 87, 39, 87,
87, 87, 19, 87, 87, 13, 87, 87, 87, 16,
87, 87, 87, 87, 87, 79, 87, 87, 87, 50,
10, 87, 34, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 18, 22, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
45, 87, 87, 28, 87, 86, 87, 87, 37, 87,
87, 87, 87, 47, 87, 30, 87, 9, 63, 87,
87, 87, 41, 87, 87, 87, 87, 87, 87, 87,
87, 87, 27, 87, 87, 87, 87, 87, 87, 87,
87, 87, 84, 87, 24, 87, 65, 87, 87, 87,
87, 35, 87, 87, 87, 87, 87, 87, 87, 29,
64, 21, 56, 87, 74, 87, 87, 87, 42, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 55,
87, 87, 87, 87, 87, 87, 87, 38, 31, 78,
17, 87, 82, 73, 87, 54, 87, 62, 87, 51,
87, 87, 46, 87, 75, 87, 77, 87, 87, 32,
87, 87, 87, 33, 71, 87, 87, 87, 87, 57,
87, 49, 48, 87, 87, 87, 52, 61, 87, 87,
20, 87, 87, 72, 80, 87, 87, 76, 87, 67,
87, 87, 87, 87, 87, 36, 87, 66, 87, 83,
87, 87, 87, 85, 87, 58, 87, 87, 14, 87,
69, 68, 87, 40, 87, 81, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 70, 87, 87, 87,
87, 87, 87, 59, 0
0, 0, 110, 110, 0, 0, 0, 0, 116, 114,
113, 113, 6, 105, 3, 94, 100, 103, 101, 98,
102, 114, 104, 1, 114, 99, 97, 95, 96, 108,
88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 88, 88, 88, 88, 88, 106, 107,
110, 111, 4, 5, 7, 8, 113, 89, 109, 2,
1, 90, 91, 93, 92, 88, 88, 88, 88, 88,
88, 43, 88, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 88, 88, 88, 88, 88, 26, 15,
23, 88, 88, 88, 88, 53, 60, 88, 12, 88,
88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 88, 88, 88, 110, 111, 111, 112,
4, 5, 7, 8, 2, 11, 44, 88, 88, 88,
88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 88, 88, 25, 88, 88, 88, 39,
88, 88, 88, 88, 19, 88, 88, 13, 88, 88,
88, 16, 88, 88, 88, 88, 88, 79, 88, 88,
88, 50, 10, 88, 34, 88, 88, 88, 88, 88,
88, 88, 88, 88, 88, 88, 88, 88, 88, 18,
22, 88, 88, 88, 88, 88, 88, 88, 88, 88,
88, 88, 45, 88, 88, 28, 88, 86, 88, 88,
37, 88, 88, 88, 88, 88, 47, 88, 30, 88,
9, 63, 88, 88, 88, 41, 88, 88, 88, 88,
88, 88, 88, 88, 88, 27, 88, 88, 88, 88,
88, 88, 88, 88, 88, 84, 88, 24, 88, 65,
88, 88, 88, 88, 35, 88, 88, 88, 88, 88,
88, 88, 29, 64, 21, 88, 56, 88, 74, 88,
88, 88, 42, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 55, 88, 88, 88, 88, 88, 88,
88, 38, 31, 78, 17, 88, 82, 73, 88, 54,
88, 62, 88, 51, 88, 88, 88, 46, 88, 75,
88, 77, 88, 88, 32, 88, 88, 88, 33, 71,
88, 88, 88, 88, 57, 88, 49, 48, 88, 88,
88, 52, 61, 88, 88, 88, 20, 88, 88, 72,
80, 88, 88, 76, 88, 67, 88, 88, 88, 88,
88, 36, 88, 87, 66, 88, 83, 88, 88, 88,
85, 88, 58, 88, 88, 14, 88, 69, 68, 88,
40, 88, 81, 88, 88, 88, 88, 88, 88, 88,
88, 88, 88, 70, 88, 88, 88, 88, 88, 88,
59, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
......@@ -452,103 +454,103 @@ static yyconst flex_int32_t yy_meta[50] =
5, 5, 5, 5, 5, 5, 5, 1, 1
} ;
static yyconst flex_int16_t yy_base[394] =
static yyconst flex_int16_t yy_base[401] =
{ 0,
0, 0, 417, 416, 418, 417, 418, 417, 420, 427,
48, 50, 427, 427, 427, 427, 427, 427, 427, 427,
427, 406, 409, 41, 398, 427, 38, 427, 397, 427,
20, 33, 32, 46, 40, 44, 0, 51, 58, 45,
61, 376, 66, 67, 68, 27, 392, 70, 427, 427,
0, 98, 0, 407, 0, 408, 108, 427, 427, 396,
54, 427, 427, 427, 427, 0, 385, 84, 381, 373,
371, 0, 384, 53, 80, 379, 365, 92, 363, 376,
361, 375, 369, 357, 361, 357, 359, 0, 93, 0,
359, 357, 351, 358, 0, 0, 364, 364, 347, 87,
98, 362, 86, 88, 353, 103, 345, 361, 357, 335,
98, 356, 347, 101, 340, 0, 127, 131, 427, 0,
372, 0, 373, 361, 0, 0, 349, 344, 351, 349,
332, 330, 329, 334, 118, 332, 344, 104, 332, 338,
339, 321, 321, 120, 0, 319, 335, 336, 0, 323,
330, 121, 123, 327, 317, 326, 319, 316, 324, 0,
314, 324, 322, 313, 303, 297, 310, 295, 315, 0,
0, 300, 0, 314, 305, 302, 128, 298, 305, 312,
291, 293, 298, 298, 290, 293, 288, 0, 0, 300,
284, 294, 301, 292, 280, 279, 293, 282, 295, 275,
0, 285, 267, 0, 286, 0, 283, 270, 0, 265,
270, 269, 279, 0, 265, 0, 269, 0, 0, 265,
262, 276, 0, 261, 261, 259, 275, 260, 272, 254,
272, 267, 0, 262, 262, 248, 247, 260, 246, 260,
259, 258, 0, 242, 0, 236, 0, 255, 239, 238,
238, 0, 251, 241, 236, 235, 247, 237, 236, 0,
0, 0, 0, 229, 0, 243, 239, 225, 0, 239,
240, 223, 228, 221, 239, 221, 218, 219, 216, 0,
221, 233, 220, 227, 217, 225, 210, 0, 0, 0,
202, 209, 0, 0, 206, 0, 205, 0, 219, 0,
220, 207, 0, 203, 0, 206, 0, 198, 200, 0,
199, 213, 206, 0, 0, 209, 212, 194, 209, 0,
205, 0, 0, 189, 203, 202, 0, 0, 186, 185,
0, 200, 185, 0, 0, 191, 187, 0, 182, 0,
194, 194, 182, 192, 181, 0, 168, 0, 188, 0,
172, 166, 172, 0, 163, 0, 168, 181, 0, 180,
0, 0, 171, 0, 175, 0, 162, 162, 168, 154,
177, 169, 169, 156, 143, 114, 0, 126, 131, 122,
119, 115, 107, 0, 427, 163, 168, 173, 143, 178,
183, 188, 193
0, 0, 424, 423, 425, 424, 425, 424, 427, 434,
48, 50, 434, 434, 434, 434, 434, 434, 434, 434,
434, 413, 416, 41, 405, 434, 38, 434, 404, 434,
20, 33, 32, 46, 40, 44, 0, 54, 52, 48,
60, 383, 65, 66, 74, 27, 399, 69, 434, 434,
0, 97, 0, 414, 0, 415, 111, 434, 434, 403,
54, 434, 434, 434, 434, 0, 392, 69, 388, 380,
378, 0, 391, 79, 82, 386, 372, 94, 370, 383,
368, 382, 376, 364, 368, 364, 366, 366, 0, 82,
0, 365, 363, 357, 364, 0, 0, 370, 370, 353,
89, 98, 368, 93, 95, 359, 106, 351, 367, 363,
341, 101, 362, 353, 112, 346, 0, 134, 135, 434,
0, 378, 0, 379, 367, 0, 0, 355, 350, 357,
355, 338, 336, 335, 340, 106, 338, 350, 93, 338,
344, 345, 327, 327, 121, 0, 325, 341, 342, 0,
329, 338, 335, 119, 126, 332, 322, 331, 324, 321,
329, 0, 319, 329, 327, 318, 308, 302, 315, 300,
320, 0, 0, 305, 0, 319, 310, 307, 130, 303,
310, 317, 296, 298, 303, 303, 295, 298, 293, 0,
0, 305, 289, 299, 306, 297, 285, 284, 298, 287,
300, 280, 0, 290, 272, 0, 291, 0, 288, 275,
0, 274, 269, 274, 273, 283, 0, 269, 0, 273,
0, 0, 269, 266, 280, 0, 265, 265, 263, 279,
264, 276, 258, 276, 271, 0, 266, 266, 252, 251,
264, 250, 264, 263, 262, 0, 246, 0, 240, 0,
259, 243, 242, 242, 0, 255, 245, 240, 239, 251,
241, 240, 0, 0, 0, 244, 0, 232, 0, 246,
242, 228, 0, 242, 243, 226, 231, 224, 242, 224,
221, 222, 219, 0, 224, 236, 223, 230, 220, 228,
213, 0, 0, 0, 205, 212, 0, 0, 209, 0,
208, 0, 222, 0, 223, 210, 209, 0, 205, 0,
208, 0, 200, 202, 0, 201, 215, 208, 0, 0,
211, 214, 196, 211, 0, 207, 0, 0, 191, 205,
204, 0, 0, 188, 187, 192, 0, 201, 186, 0,
0, 192, 188, 0, 183, 0, 195, 195, 183, 193,
182, 0, 169, 0, 0, 189, 0, 173, 167, 173,
0, 164, 0, 169, 182, 0, 181, 0, 0, 172,
0, 176, 0, 163, 163, 169, 155, 178, 167, 167,
149, 125, 116, 0, 127, 133, 124, 121, 117, 109,
0, 434, 165, 170, 175, 145, 180, 185, 190, 195
} ;
static yyconst flex_int16_t yy_def[394] =
static yyconst flex_int16_t yy_def[401] =
{ 0,
385, 1, 386, 386, 387, 387, 388, 388, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 385, 385,
390, 391, 392, 385, 393, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 390, 391, 391, 385, 392,
385, 393, 385, 385, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
389, 389, 389, 389, 0, 385, 385, 385, 385, 385,
385, 385, 385
392, 1, 393, 393, 394, 394, 395, 395, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 392, 392,
397, 398, 399, 392, 400, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 397, 398, 398, 392,
399, 392, 400, 392, 392, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
396, 0, 392, 392, 392, 392, 392, 392, 392, 392
} ;
static yyconst flex_int16_t yy_nxt[477] =
static yyconst flex_int16_t yy_nxt[484] =
{ 0,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
......@@ -556,55 +558,56 @@ static yyconst flex_int16_t yy_nxt[477] =
37, 37, 39, 37, 40, 41, 42, 37, 43, 44,
45, 46, 47, 48, 37, 37, 37, 49, 50, 57,
57, 57, 57, 60, 67, 61, 63, 64, 69, 68,
73, 111, 70, 112, 74, 71, 60, 75, 61, 84,
76, 78, 81, 77, 82, 79, 85, 88, 72, 86,
93, 80, 87, 91, 83, 89, 94, 95, 132, 108,
90, 101, 104, 92, 133, 96, 109, 97, 114, 98,
102, 103, 99, 110, 105, 115, 118, 126, 106, 57,
57, 119, 107, 134, 135, 139, 161, 151, 167, 163,
169, 136, 162, 127, 140, 172, 182, 178, 170, 168,
183, 141, 152, 153, 164, 385, 173, 179, 165, 118,
385, 193, 197, 198, 119, 204, 211, 66, 213, 205,
234, 235, 384, 383, 382, 381, 380, 194, 214, 379,
378, 212, 236, 51, 51, 51, 51, 51, 53, 53,
53, 53, 53, 55, 55, 55, 55, 55, 116, 116,
116, 377, 116, 117, 117, 117, 117, 117, 120, 120,
376, 120, 120, 122, 375, 122, 122, 122, 374, 373,
372, 371, 370, 369, 368, 367, 366, 365, 364, 363,
362, 361, 360, 359, 358, 357, 356, 355, 354, 353,
352, 351, 350, 349, 348, 347, 346, 345, 344, 343,
342, 341, 340, 339, 338, 337, 336, 335, 334, 333,
332, 331, 330, 329, 328, 327, 326, 325, 324, 323,
322, 321, 320, 319, 318, 317, 316, 315, 314, 313,
312, 311, 310, 309, 308, 307, 306, 305, 304, 303,
302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
282, 281, 280, 279, 278, 277, 276, 275, 274, 273,
272, 271, 270, 269, 268, 267, 266, 265, 264, 263,
262, 261, 260, 259, 258, 257, 256, 255, 254, 253,
252, 251, 250, 249, 248, 247, 246, 245, 244, 243,
242, 241, 240, 239, 238, 237, 233, 232, 231, 230,
229, 228, 227, 226, 225, 224, 223, 222, 221, 220,
219, 218, 217, 216, 215, 210, 209, 208, 207, 206,
203, 202, 201, 200, 199, 196, 195, 192, 191, 190,
189, 188, 187, 186, 185, 124, 123, 121, 184, 181,
180, 177, 176, 175, 174, 171, 166, 160, 159, 158,
157, 156, 155, 154, 150, 149, 148, 147, 146, 145,
144, 143, 142, 138, 137, 131, 130, 129, 128, 125,
124, 123, 121, 113, 100, 65, 62, 59, 58, 385,
56, 56, 54, 54, 52, 52, 9, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385
73, 112, 70, 113, 74, 71, 60, 75, 61, 84,
76, 78, 81, 77, 82, 79, 85, 92, 72, 86,
89, 80, 87, 94, 83, 88, 96, 93, 90, 95,
102, 105, 127, 91, 97, 109, 98, 115, 99, 103,
104, 100, 110, 106, 116, 119, 153, 107, 128, 111,
120, 108, 57, 57, 133, 135, 136, 140, 163, 165,
134, 154, 155, 137, 164, 169, 141, 171, 174, 195,
180, 199, 200, 142, 166, 172, 170, 184, 167, 175,
181, 185, 392, 119, 214, 196, 206, 392, 120, 66,
207, 216, 237, 238, 391, 390, 389, 388, 387, 215,
386, 217, 385, 384, 239, 51, 51, 51, 51, 51,
53, 53, 53, 53, 53, 55, 55, 55, 55, 55,
117, 117, 117, 383, 117, 118, 118, 118, 118, 118,
121, 121, 382, 121, 121, 123, 381, 123, 123, 123,
380, 379, 378, 377, 376, 375, 374, 373, 372, 371,
370, 369, 368, 367, 366, 365, 364, 363, 362, 361,
360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
350, 349, 348, 347, 346, 345, 344, 343, 342, 341,
340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
330, 329, 328, 327, 326, 325, 324, 323, 322, 321,
320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
300, 299, 298, 297, 296, 295, 294, 293, 292, 291,
290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
280, 279, 278, 277, 276, 275, 274, 273, 272, 271,
270, 269, 268, 267, 266, 265, 264, 263, 262, 261,
260, 259, 258, 257, 256, 255, 254, 253, 252, 251,
250, 249, 248, 247, 246, 245, 244, 243, 242, 241,
240, 236, 235, 234, 233, 232, 231, 230, 229, 228,
227, 226, 225, 224, 223, 222, 221, 220, 219, 218,
213, 212, 211, 210, 209, 208, 205, 204, 203, 202,
201, 198, 197, 194, 193, 192, 191, 190, 189, 188,
187, 125, 124, 122, 186, 183, 182, 179, 178, 177,
176, 173, 168, 162, 161, 160, 159, 158, 157, 156,
152, 151, 150, 149, 148, 147, 146, 145, 144, 143,
139, 138, 132, 131, 130, 129, 126, 125, 124, 122,
114, 101, 65, 62, 59, 58, 392, 56, 56, 54,
54, 52, 52, 9, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392
} ;
static yyconst flex_int16_t yy_chk[477] =
static yyconst flex_int16_t yy_chk[484] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
......@@ -613,51 +616,52 @@ static yyconst flex_int16_t yy_chk[477] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 11,
11, 12, 12, 24, 31, 24, 27, 27, 32, 31,
33, 46, 32, 46, 33, 32, 61, 33, 61, 36,
33, 34, 35, 33, 35, 34, 36, 38, 32, 36,
40, 34, 36, 39, 35, 38, 40, 41, 74, 45,
38, 43, 44, 39, 74, 41, 45, 41, 48, 41,
43, 43, 41, 45, 44, 48, 52, 68, 44, 57,
57, 52, 44, 75, 75, 78, 100, 89, 103, 101,
104, 75, 100, 68, 78, 106, 114, 111, 104, 103,
114, 78, 89, 89, 101, 117, 106, 111, 101, 118,
117, 135, 138, 138, 118, 144, 152, 389, 153, 144,
177, 177, 383, 382, 381, 380, 379, 135, 153, 378,
376, 152, 177, 386, 386, 386, 386, 386, 387, 387,
387, 387, 387, 388, 388, 388, 388, 388, 390, 390,
390, 375, 390, 391, 391, 391, 391, 391, 392, 392,
374, 392, 392, 393, 373, 393, 393, 393, 372, 371,
370, 369, 368, 367, 365, 363, 360, 358, 357, 355,
353, 352, 351, 349, 347, 345, 344, 343, 342, 341,
339, 337, 336, 333, 332, 330, 329, 326, 325, 324,
321, 319, 318, 317, 316, 313, 312, 311, 309, 308,
306, 304, 302, 301, 299, 297, 295, 292, 291, 287,
286, 285, 284, 283, 282, 281, 279, 278, 277, 276,
275, 274, 273, 272, 271, 270, 268, 267, 266, 264,
259, 258, 257, 256, 255, 254, 253, 251, 250, 249,
248, 246, 244, 242, 241, 240, 239, 238, 237, 236,
235, 234, 232, 231, 230, 229, 228, 227, 226, 225,
224, 222, 221, 220, 217, 215, 213, 212, 211, 210,
208, 207, 205, 203, 202, 200, 199, 198, 197, 196,
195, 194, 193, 192, 191, 190, 187, 186, 185, 184,
183, 182, 181, 180, 179, 178, 176, 175, 174, 172,
169, 168, 167, 166, 165, 164, 163, 162, 161, 159,
158, 157, 156, 155, 154, 151, 150, 148, 147, 146,
143, 142, 141, 140, 139, 137, 136, 134, 133, 132,
131, 130, 129, 128, 127, 124, 123, 121, 115, 113,
112, 110, 109, 108, 107, 105, 102, 99, 98, 97,
94, 93, 92, 91, 87, 86, 85, 84, 83, 82,
81, 80, 79, 77, 76, 73, 71, 70, 69, 67,
60, 56, 54, 47, 42, 29, 25, 23, 22, 9,
8, 7, 6, 5, 4, 3, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
385, 385, 385, 385, 385, 385
33, 34, 35, 33, 35, 34, 36, 39, 32, 36,
38, 34, 36, 40, 35, 36, 41, 39, 38, 40,
43, 44, 68, 38, 41, 45, 41, 48, 41, 43,
43, 41, 45, 44, 48, 52, 90, 44, 68, 45,
52, 44, 57, 57, 74, 75, 75, 78, 101, 102,
74, 90, 90, 75, 101, 104, 78, 105, 107, 136,
112, 139, 139, 78, 102, 105, 104, 115, 102, 107,
112, 115, 118, 119, 154, 136, 145, 118, 119, 396,
145, 155, 179, 179, 390, 389, 388, 387, 386, 154,
385, 155, 383, 382, 179, 393, 393, 393, 393, 393,
394, 394, 394, 394, 394, 395, 395, 395, 395, 395,
397, 397, 397, 381, 397, 398, 398, 398, 398, 398,
399, 399, 380, 399, 399, 400, 379, 400, 400, 400,
378, 377, 376, 375, 374, 372, 370, 367, 365, 364,
362, 360, 359, 358, 356, 353, 351, 350, 349, 348,
347, 345, 343, 342, 339, 338, 336, 335, 334, 331,
330, 329, 326, 324, 323, 322, 321, 318, 317, 316,
314, 313, 311, 309, 307, 306, 305, 303, 301, 299,
296, 295, 291, 290, 289, 288, 287, 286, 285, 283,
282, 281, 280, 279, 278, 277, 276, 275, 274, 272,
271, 270, 268, 266, 262, 261, 260, 259, 258, 257,
256, 254, 253, 252, 251, 249, 247, 245, 244, 243,
242, 241, 240, 239, 238, 237, 235, 234, 233, 232,
231, 230, 229, 228, 227, 225, 224, 223, 220, 218,
216, 215, 214, 213, 212, 210, 209, 207, 205, 204,
202, 201, 200, 199, 198, 197, 196, 195, 194, 193,
192, 189, 188, 187, 186, 185, 184, 183, 182, 181,
180, 178, 177, 176, 174, 171, 170, 169, 168, 167,
166, 165, 164, 163, 161, 160, 159, 158, 157, 156,
153, 152, 151, 149, 148, 147, 144, 143, 142, 141,
140, 138, 137, 135, 134, 133, 132, 131, 130, 129,
128, 125, 124, 122, 116, 114, 113, 111, 110, 109,
108, 106, 103, 100, 99, 98, 95, 94, 93, 92,
88, 87, 86, 85, 84, 83, 82, 81, 80, 79,
77, 76, 73, 71, 70, 69, 67, 60, 56, 54,
47, 42, 29, 25, 23, 22, 9, 8, 7, 6,
5, 4, 3, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
392, 392, 392
} ;
static yy_state_type yy_last_accepting_state;
......@@ -746,7 +750,7 @@ string_append(
#line 749 "_flex_tmp.c"
#line 753 "_flex_tmp.c"
#define INITIAL 0
#define comment 1
......@@ -901,7 +905,7 @@ YY_DECL
#line 89 "pars0lex.l"
#line 904 "_flex_tmp.c"
#line 908 "_flex_tmp.c"
if ( (yy_init) )
{
......@@ -954,13 +958,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 386 )
if ( yy_current_state >= 393 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 385 );
while ( yy_current_state != 392 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
......@@ -1654,58 +1658,57 @@ case 87:
YY_RULE_SETUP
#line 497 "pars0lex.l"
{
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*)yytext,
ut_strlen(yytext));
return(PARS_ID_TOKEN);
return(PARS_FUNCTION_TOKEN);
}
YY_BREAK
case 88:
YY_RULE_SETUP
#line 504 "pars0lex.l"
#line 501 "pars0lex.l"
{
return(PARS_DDOT_TOKEN);
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*)yytext,
ut_strlen(yytext));
return(PARS_ID_TOKEN);
}
YY_BREAK
case 89:
YY_RULE_SETUP
#line 508 "pars0lex.l"
{
return(PARS_ASSIGN_TOKEN);
return(PARS_DDOT_TOKEN);
}
YY_BREAK
case 90:
YY_RULE_SETUP
#line 512 "pars0lex.l"
{
return(PARS_LE_TOKEN);
return(PARS_ASSIGN_TOKEN);
}
YY_BREAK
case 91:
YY_RULE_SETUP
#line 516 "pars0lex.l"
{
return(PARS_GE_TOKEN);
return(PARS_LE_TOKEN);
}
YY_BREAK
case 92:
YY_RULE_SETUP
#line 520 "pars0lex.l"
{
return(PARS_NE_TOKEN);
return(PARS_GE_TOKEN);
}
YY_BREAK
case 93:
YY_RULE_SETUP
#line 524 "pars0lex.l"
{
return((int)(*yytext));
return(PARS_NE_TOKEN);
}
YY_BREAK
case 94:
YY_RULE_SETUP
#line 529 "pars0lex.l"
#line 528 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1713,7 +1716,7 @@ YY_RULE_SETUP
YY_BREAK
case 95:
YY_RULE_SETUP
#line 534 "pars0lex.l"
#line 533 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1721,7 +1724,7 @@ YY_RULE_SETUP
YY_BREAK
case 96:
YY_RULE_SETUP
#line 539 "pars0lex.l"
#line 538 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1729,7 +1732,7 @@ YY_RULE_SETUP
YY_BREAK
case 97:
YY_RULE_SETUP
#line 544 "pars0lex.l"
#line 543 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1737,7 +1740,7 @@ YY_RULE_SETUP
YY_BREAK
case 98:
YY_RULE_SETUP
#line 549 "pars0lex.l"
#line 548 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1745,7 +1748,7 @@ YY_RULE_SETUP
YY_BREAK
case 99:
YY_RULE_SETUP
#line 554 "pars0lex.l"
#line 553 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1753,7 +1756,7 @@ YY_RULE_SETUP
YY_BREAK
case 100:
YY_RULE_SETUP
#line 559 "pars0lex.l"
#line 558 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1761,7 +1764,7 @@ YY_RULE_SETUP
YY_BREAK
case 101:
YY_RULE_SETUP
#line 564 "pars0lex.l"
#line 563 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1769,7 +1772,7 @@ YY_RULE_SETUP
YY_BREAK
case 102:
YY_RULE_SETUP
#line 569 "pars0lex.l"
#line 568 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1777,7 +1780,7 @@ YY_RULE_SETUP
YY_BREAK
case 103:
YY_RULE_SETUP
#line 574 "pars0lex.l"
#line 573 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1785,7 +1788,7 @@ YY_RULE_SETUP
YY_BREAK
case 104:
YY_RULE_SETUP
#line 579 "pars0lex.l"
#line 578 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1793,7 +1796,7 @@ YY_RULE_SETUP
YY_BREAK
case 105:
YY_RULE_SETUP
#line 584 "pars0lex.l"
#line 583 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1801,7 +1804,7 @@ YY_RULE_SETUP
YY_BREAK
case 106:
YY_RULE_SETUP
#line 589 "pars0lex.l"
#line 588 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1809,7 +1812,7 @@ YY_RULE_SETUP
YY_BREAK
case 107:
YY_RULE_SETUP
#line 594 "pars0lex.l"
#line 593 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1817,35 +1820,43 @@ YY_RULE_SETUP
YY_BREAK
case 108:
YY_RULE_SETUP
#line 599 "pars0lex.l"
BEGIN(comment); /* eat up comment */
#line 598 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 109:
/* rule 109 can match eol */
YY_RULE_SETUP
#line 601 "pars0lex.l"
#line 603 "pars0lex.l"
BEGIN(comment); /* eat up comment */
YY_BREAK
case 110:
/* rule 110 can match eol */
YY_RULE_SETUP
#line 602 "pars0lex.l"
#line 605 "pars0lex.l"
YY_BREAK
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
#line 603 "pars0lex.l"
BEGIN(INITIAL);
#line 606 "pars0lex.l"
YY_BREAK
case 112:
/* rule 112 can match eol */
YY_RULE_SETUP
#line 605 "pars0lex.l"
/* eat up whitespace */
#line 607 "pars0lex.l"
BEGIN(INITIAL);
YY_BREAK
case 113:
/* rule 113 can match eol */
YY_RULE_SETUP
#line 608 "pars0lex.l"
#line 609 "pars0lex.l"
/* eat up whitespace */
YY_BREAK
case 114:
YY_RULE_SETUP
#line 612 "pars0lex.l"
{
fprintf(stderr,"Unrecognized character: %02x\n",
*yytext);
......@@ -1855,12 +1866,12 @@ YY_RULE_SETUP
return(0);
}
YY_BREAK
case 114:
case 115:
YY_RULE_SETUP
#line 617 "pars0lex.l"
#line 621 "pars0lex.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1863 "_flex_tmp.c"
#line 1874 "_flex_tmp.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(quoted):
......@@ -2148,7 +2159,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 386 )
if ( yy_current_state >= 393 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
......@@ -2176,11 +2187,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 386 )
if ( yy_current_state >= 393 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 385);
yy_is_jam = (yy_current_state == 392);
return yy_is_jam ? 0 : yy_current_state;
}
......@@ -2703,7 +2714,7 @@ void yyfree (void * ptr )
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
#line 617 "pars0lex.l"
#line 621 "pars0lex.l"
......@@ -140,7 +140,8 @@
PARS_WORK_TOKEN = 342,
PARS_UNSIGNED_TOKEN = 343,
PARS_EXIT_TOKEN = 344,
NEG = 345
PARS_FUNCTION_TOKEN = 345,
NEG = 346
};
#endif
#define PARS_INT_LIT 258
......@@ -230,7 +231,8 @@
#define PARS_WORK_TOKEN 342
#define PARS_UNSIGNED_TOKEN 343
#define PARS_EXIT_TOKEN 344
#define NEG 345
#define PARS_FUNCTION_TOKEN 345
#define NEG 346
......@@ -283,7 +285,7 @@ typedef int YYSTYPE;
/* Line 214 of yacc.c. */
#line 287 "pars0grm.tab.c"
#line 289 "pars0grm.tab.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE
......@@ -389,20 +391,20 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 97
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 707
#define YYLAST 703
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 106
#define YYNTOKENS 107
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 66
#define YYNNTS 69
/* YYNRULES -- Number of rules. */
#define YYNRULES 168
#define YYNRULES 173
/* YYNRULES -- Number of states. */
#define YYNSTATES 326
#define YYNSTATES 335
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 345
#define YYMAXUTOK 346
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
......@@ -413,16 +415,16 @@ static const unsigned char yytranslate[] =
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 98, 2, 2,
100, 101, 95, 94, 103, 93, 2, 96, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 99,
91, 90, 92, 102, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 99, 2, 2,
101, 102, 96, 95, 104, 94, 2, 97, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 100,
92, 91, 93, 103, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 104, 2, 105, 2, 2, 2, 2,
2, 2, 2, 105, 2, 106, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
......@@ -444,7 +446,7 @@ static const unsigned char yytranslate[] =
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 97
85, 86, 87, 88, 89, 90, 98
};
#if YYDEBUG
......@@ -459,96 +461,100 @@ static const unsigned short int yyprhs[] =
116, 120, 124, 128, 132, 136, 140, 144, 148, 151,
155, 159, 161, 163, 165, 167, 169, 171, 173, 175,
177, 179, 181, 182, 184, 188, 195, 200, 202, 204,
206, 208, 212, 213, 215, 219, 220, 222, 226, 228,
233, 239, 244, 245, 247, 251, 253, 257, 259, 260,
263, 264, 267, 268, 271, 272, 274, 276, 277, 282,
291, 295, 301, 304, 308, 310, 314, 319, 324, 327,
330, 334, 337, 340, 343, 347, 352, 354, 357, 358,
361, 363, 371, 378, 389, 391, 393, 396, 399, 404,
410, 412, 416, 417, 421, 422, 424, 425, 428, 429,
431, 439, 441, 445, 446, 448, 449, 451, 462, 465,
468, 470, 472, 474, 476, 478, 482, 486, 487, 489,
493, 497, 498, 500, 503, 510, 511, 513, 516
206, 210, 212, 216, 217, 219, 223, 224, 226, 230,
232, 237, 243, 248, 249, 251, 255, 257, 261, 263,
264, 267, 268, 271, 272, 275, 276, 278, 280, 281,
286, 295, 299, 305, 308, 312, 314, 318, 323, 328,
331, 334, 338, 341, 344, 347, 351, 356, 358, 361,
362, 365, 367, 375, 382, 393, 395, 397, 400, 403,
408, 413, 419, 421, 425, 426, 430, 431, 433, 434,
437, 438, 440, 448, 450, 454, 455, 457, 458, 460,
471, 474, 477, 479, 481, 483, 485, 487, 491, 495,
496, 498, 502, 506, 507, 509, 512, 519, 524, 526,
528, 529, 531, 534
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short int yyrhs[] =
{
107, 0, -1, 171, 99, -1, 112, -1, 113, 99,
-1, 144, 99, -1, 145, 99, -1, 146, 99, -1,
143, 99, -1, 147, 99, -1, 139, 99, -1, 126,
99, -1, 128, 99, -1, 138, 99, -1, 136, 99,
-1, 137, 99, -1, 133, 99, -1, 134, 99, -1,
148, 99, -1, 150, 99, -1, 149, 99, -1, 162,
99, -1, 163, 99, -1, 157, 99, -1, 161, 99,
-1, 107, -1, 108, 107, -1, 7, -1, 110, 100,
117, 101, -1, 3, -1, 4, -1, 5, -1, 6,
-1, 65, -1, 109, 94, 109, -1, 109, 93, 109,
-1, 109, 95, 109, -1, 109, 96, 109, -1, 93,
109, -1, 100, 109, 101, -1, 109, 90, 109, -1,
109, 91, 109, -1, 109, 92, 109, -1, 109, 11,
109, -1, 109, 12, 109, -1, 109, 13, 109, -1,
109, 8, 109, -1, 109, 9, 109, -1, 10, 109,
-1, 7, 98, 69, -1, 65, 98, 69, -1, 70,
108, 0, -1, 175, 100, -1, 113, -1, 114, 100,
-1, 146, 100, -1, 147, 100, -1, 148, 100, -1,
145, 100, -1, 149, 100, -1, 141, 100, -1, 128,
100, -1, 130, 100, -1, 140, 100, -1, 138, 100,
-1, 139, 100, -1, 135, 100, -1, 136, 100, -1,
150, 100, -1, 152, 100, -1, 151, 100, -1, 164,
100, -1, 165, 100, -1, 159, 100, -1, 163, 100,
-1, 108, -1, 109, 108, -1, 7, -1, 111, 101,
119, 102, -1, 3, -1, 4, -1, 5, -1, 6,
-1, 65, -1, 110, 95, 110, -1, 110, 94, 110,
-1, 110, 96, 110, -1, 110, 97, 110, -1, 94,
110, -1, 101, 110, 102, -1, 110, 91, 110, -1,
110, 92, 110, -1, 110, 93, 110, -1, 110, 11,
110, -1, 110, 12, 110, -1, 110, 13, 110, -1,
110, 8, 110, -1, 110, 9, 110, -1, 10, 110,
-1, 7, 99, 69, -1, 65, 99, 69, -1, 70,
-1, 71, -1, 72, -1, 73, -1, 74, -1, 76,
-1, 77, -1, 78, -1, 79, -1, 82, -1, 83,
-1, -1, 102, -1, 111, 103, 102, -1, 104, 7,
100, 111, 101, 105, -1, 114, 100, 117, 101, -1,
75, -1, 80, -1, 81, -1, 7, -1, 115, 103,
7, -1, -1, 7, -1, 116, 103, 7, -1, -1,
109, -1, 117, 103, 109, -1, 109, -1, 35, 100,
95, 101, -1, 35, 100, 36, 7, 101, -1, 34,
100, 109, 101, -1, -1, 118, -1, 119, 103, 118,
-1, 95, -1, 119, 48, 116, -1, 119, -1, -1,
38, 109, -1, -1, 39, 50, -1, -1, 41, 42,
-1, -1, 45, -1, 46, -1, -1, 43, 44, 7,
124, -1, 33, 120, 37, 115, 121, 122, 123, 125,
-1, 47, 48, 7, -1, 127, 49, 100, 117, 101,
-1, 127, 126, -1, 7, 90, 109, -1, 129, -1,
130, 103, 129, -1, 38, 53, 54, 7, -1, 50,
7, 51, 130, -1, 132, 121, -1, 132, 131, -1,
52, 37, 7, -1, 135, 121, -1, 135, 131, -1,
84, 126, -1, 7, 62, 109, -1, 29, 109, 27,
108, -1, 140, -1, 141, 140, -1, -1, 28, 108,
-1, 141, -1, 26, 109, 27, 108, 142, 25, 26,
-1, 31, 109, 30, 108, 25, 30, -1, 39, 7,
15, 109, 40, 109, 30, 108, 25, 30, -1, 89,
-1, 32, -1, 66, 7, -1, 68, 7, -1, 67,
7, 48, 116, -1, 7, 164, 153, 154, 155, -1,
151, -1, 152, 103, 151, -1, -1, 100, 3, 101,
-1, -1, 88, -1, -1, 10, 6, -1, -1, 60,
-1, 55, 56, 7, 100, 152, 101, 156, -1, 7,
-1, 158, 103, 7, -1, -1, 58, -1, -1, 59,
-1, 55, 159, 160, 57, 7, 61, 7, 100, 158,
101, -1, 85, 87, -1, 86, 87, -1, 19, -1,
20, -1, 22, -1, 17, -1, 18, -1, 7, 15,
164, -1, 7, 16, 164, -1, -1, 165, -1, 166,
103, 165, -1, 7, 164, 99, -1, -1, 167, -1,
168, 167, -1, 63, 64, 7, 23, 126, 99, -1,
-1, 169, -1, 170, 169, -1, 14, 7, 100, 166,
101, 23, 168, 170, 24, 108, 25, -1
-1, -1, 103, -1, 112, 104, 103, -1, 105, 7,
101, 112, 102, 106, -1, 115, 101, 119, 102, -1,
75, -1, 80, -1, 81, -1, 7, 101, 102, -1,
7, -1, 117, 104, 7, -1, -1, 7, -1, 118,
104, 7, -1, -1, 110, -1, 119, 104, 110, -1,
110, -1, 35, 101, 96, 102, -1, 35, 101, 36,
7, 102, -1, 34, 101, 110, 102, -1, -1, 120,
-1, 121, 104, 120, -1, 96, -1, 121, 48, 118,
-1, 121, -1, -1, 38, 110, -1, -1, 39, 50,
-1, -1, 41, 42, -1, -1, 45, -1, 46, -1,
-1, 43, 44, 7, 126, -1, 33, 122, 37, 117,
123, 124, 125, 127, -1, 47, 48, 7, -1, 129,
49, 101, 119, 102, -1, 129, 128, -1, 7, 91,
110, -1, 131, -1, 132, 104, 131, -1, 38, 53,
54, 7, -1, 50, 7, 51, 132, -1, 134, 123,
-1, 134, 133, -1, 52, 37, 7, -1, 137, 123,
-1, 137, 133, -1, 84, 128, -1, 7, 62, 110,
-1, 29, 110, 27, 109, -1, 142, -1, 143, 142,
-1, -1, 28, 109, -1, 143, -1, 26, 110, 27,
109, 144, 25, 26, -1, 31, 110, 30, 109, 25,
30, -1, 39, 7, 15, 110, 40, 110, 30, 109,
25, 30, -1, 89, -1, 32, -1, 66, 7, -1,
68, 7, -1, 67, 7, 48, 118, -1, 67, 7,
48, 116, -1, 7, 166, 155, 156, 157, -1, 153,
-1, 154, 104, 153, -1, -1, 101, 3, 102, -1,
-1, 88, -1, -1, 10, 6, -1, -1, 60, -1,
55, 56, 7, 101, 154, 102, 158, -1, 7, -1,
160, 104, 7, -1, -1, 58, -1, -1, 59, -1,
55, 161, 162, 57, 7, 61, 7, 101, 160, 102,
-1, 85, 87, -1, 86, 87, -1, 19, -1, 20,
-1, 22, -1, 17, -1, 18, -1, 7, 15, 166,
-1, 7, 16, 166, -1, -1, 167, -1, 168, 104,
167, -1, 7, 166, 100, -1, -1, 169, -1, 170,
169, -1, 63, 64, 7, 23, 128, 100, -1, 63,
90, 7, 100, -1, 171, -1, 172, -1, -1, 173,
-1, 174, 173, -1, 14, 7, 101, 168, 102, 23,
170, 174, 24, 109, 25, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
0, 133, 133, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
151, 152, 153, 154, 155, 159, 160, 165, 166, 168,
169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
190, 195, 196, 197, 198, 200, 201, 202, 203, 204,
205, 206, 209, 211, 212, 216, 221, 226, 227, 228,
232, 233, 238, 239, 240, 245, 246, 247, 251, 252,
257, 263, 270, 271, 272, 277, 279, 281, 285, 286,
290, 291, 296, 297, 302, 303, 304, 308, 309, 314,
324, 329, 331, 336, 340, 341, 346, 352, 359, 364,
369, 375, 380, 385, 390, 395, 401, 402, 407, 408,
410, 414, 421, 427, 435, 439, 443, 449, 455, 460,
465, 466, 471, 472, 477, 478, 484, 485, 491, 492,
498, 504, 505, 510, 511, 515, 516, 520, 528, 533,
538, 539, 540, 541, 542, 546, 549, 555, 556, 557,
562, 566, 568, 569, 573, 578, 580, 581, 585
0, 134, 134, 135, 136, 137, 138, 139, 140, 141,
142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 160, 161, 166, 167, 169,
170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
191, 196, 197, 198, 199, 201, 202, 203, 204, 205,
206, 207, 210, 212, 213, 217, 222, 227, 228, 229,
233, 237, 238, 243, 244, 245, 250, 251, 252, 256,
257, 262, 268, 275, 276, 277, 282, 284, 286, 290,
291, 295, 296, 301, 302, 307, 308, 309, 313, 314,
319, 329, 334, 336, 341, 345, 346, 351, 357, 364,
369, 374, 380, 385, 390, 395, 400, 406, 407, 412,
413, 415, 419, 426, 432, 440, 444, 448, 454, 460,
462, 467, 472, 473, 478, 479, 484, 485, 491, 492,
498, 499, 505, 511, 512, 517, 518, 522, 523, 527,
535, 540, 545, 546, 547, 548, 549, 553, 556, 562,
563, 564, 569, 573, 575, 576, 580, 586, 591, 592,
595, 597, 598, 602
};
#endif
......@@ -585,11 +591,12 @@ static const char *const yytname[] =
"PARS_SYSDATE_TOKEN", "PARS_PRINTF_TOKEN", "PARS_ASSERT_TOKEN",
"PARS_RND_TOKEN", "PARS_RND_STR_TOKEN", "PARS_ROW_PRINTF_TOKEN",
"PARS_COMMIT_TOKEN", "PARS_ROLLBACK_TOKEN", "PARS_WORK_TOKEN",
"PARS_UNSIGNED_TOKEN", "PARS_EXIT_TOKEN", "'='", "'<'", "'>'", "'-'",
"'+'", "'*'", "'/'", "NEG", "'%'", "';'", "'('", "')'", "'?'", "','",
"'{'", "'}'", "$accept", "statement", "statement_list", "exp",
"function_name", "question_mark_list", "stored_procedure_call",
"predefined_procedure_call", "predefined_procedure_name", "table_list",
"PARS_UNSIGNED_TOKEN", "PARS_EXIT_TOKEN", "PARS_FUNCTION_TOKEN", "'='",
"'<'", "'>'", "'-'", "'+'", "'*'", "'/'", "NEG", "'%'", "';'", "'('",
"')'", "'?'", "','", "'{'", "'}'", "$accept", "statement",
"statement_list", "exp", "function_name", "question_mark_list",
"stored_procedure_call", "predefined_procedure_call",
"predefined_procedure_name", "user_function_call", "table_list",
"variable_list", "exp_list", "select_item", "select_item_list",
"select_list", "search_condition", "for_update_clause",
"consistent_read_clause", "order_direction", "order_by_clause",
......@@ -607,7 +614,8 @@ static const char *const yytname[] =
"unique_def", "clustered_def", "create_index", "commit_statement",
"rollback_statement", "type_name", "parameter_declaration",
"parameter_declaration_list", "variable_declaration",
"variable_declaration_list", "cursor_declaration", "declaration_list",
"variable_declaration_list", "cursor_declaration",
"function_declaration", "declaration", "declaration_list",
"procedure_definition", 0
};
#endif
......@@ -626,31 +634,32 @@ static const unsigned short int yytoknum[] =
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
61, 60, 62, 45, 43, 42, 47, 345, 37, 59,
40, 41, 63, 44, 123, 125
345, 61, 60, 62, 45, 43, 42, 47, 346, 37,
59, 40, 41, 63, 44, 123, 125
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 106, 107, 107, 107, 107, 107, 107, 107, 107,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
107, 107, 107, 107, 107, 108, 108, 109, 109, 109,
109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
109, 110, 110, 110, 110, 110, 110, 110, 110, 110,
110, 110, 111, 111, 111, 112, 113, 114, 114, 114,
115, 115, 116, 116, 116, 117, 117, 117, 118, 118,
118, 118, 119, 119, 119, 120, 120, 120, 121, 121,
122, 122, 123, 123, 124, 124, 124, 125, 125, 126,
127, 128, 128, 129, 130, 130, 131, 132, 133, 134,
135, 136, 137, 138, 139, 140, 141, 141, 142, 142,
142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
152, 152, 153, 153, 154, 154, 155, 155, 156, 156,
157, 158, 158, 159, 159, 160, 160, 161, 162, 163,
164, 164, 164, 164, 164, 165, 165, 166, 166, 166,
167, 168, 168, 168, 169, 170, 170, 170, 171
0, 107, 108, 108, 108, 108, 108, 108, 108, 108,
108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
108, 108, 108, 108, 108, 109, 109, 110, 110, 110,
110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
110, 111, 111, 111, 111, 111, 111, 111, 111, 111,
111, 111, 112, 112, 112, 113, 114, 115, 115, 115,
116, 117, 117, 118, 118, 118, 119, 119, 119, 120,
120, 120, 120, 121, 121, 121, 122, 122, 122, 123,
123, 124, 124, 125, 125, 126, 126, 126, 127, 127,
128, 129, 130, 130, 131, 132, 132, 133, 134, 135,
136, 137, 138, 139, 140, 141, 142, 143, 143, 144,
144, 144, 145, 146, 147, 148, 149, 150, 151, 152,
152, 153, 154, 154, 155, 155, 156, 156, 157, 157,
158, 158, 159, 160, 160, 161, 161, 162, 162, 163,
164, 165, 166, 166, 166, 166, 166, 167, 167, 168,
168, 168, 169, 170, 170, 170, 171, 172, 173, 173,
174, 174, 174, 175
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
......@@ -663,16 +672,17 @@ static const unsigned char yyr2[] =
3, 3, 3, 3, 3, 3, 3, 3, 2, 3,
3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 3, 6, 4, 1, 1, 1,
1, 3, 0, 1, 3, 0, 1, 3, 1, 4,
5, 4, 0, 1, 3, 1, 3, 1, 0, 2,
0, 2, 0, 2, 0, 1, 1, 0, 4, 8,
3, 5, 2, 3, 1, 3, 4, 4, 2, 2,
3, 2, 2, 2, 3, 4, 1, 2, 0, 2,
1, 7, 6, 10, 1, 1, 2, 2, 4, 5,
1, 3, 0, 3, 0, 1, 0, 2, 0, 1,
7, 1, 3, 0, 1, 0, 1, 10, 2, 2,
1, 1, 1, 1, 1, 3, 3, 0, 1, 3,
3, 0, 1, 2, 6, 0, 1, 2, 11
3, 1, 3, 0, 1, 3, 0, 1, 3, 1,
4, 5, 4, 0, 1, 3, 1, 3, 1, 0,
2, 0, 2, 0, 2, 0, 1, 1, 0, 4,
8, 3, 5, 2, 3, 1, 3, 4, 4, 2,
2, 3, 2, 2, 2, 3, 4, 1, 2, 0,
2, 1, 7, 6, 10, 1, 1, 2, 2, 4,
4, 5, 1, 3, 0, 3, 0, 1, 0, 2,
0, 1, 7, 1, 3, 0, 1, 0, 1, 10,
2, 2, 1, 1, 1, 1, 1, 3, 3, 0,
1, 3, 3, 0, 1, 2, 6, 4, 1, 1,
0, 1, 2, 11
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
......@@ -680,103 +690,105 @@ static const unsigned char yyr2[] =
means the default is an error. */
static const unsigned char yydefact[] =
{
0, 0, 0, 0, 0, 125, 82, 0, 0, 0,
0, 143, 0, 0, 0, 67, 68, 69, 0, 0,
0, 124, 0, 0, 3, 0, 0, 0, 0, 0,
88, 0, 0, 88, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 126, 83, 0, 0, 0,
0, 145, 0, 0, 0, 67, 68, 69, 0, 0,
0, 125, 0, 0, 3, 0, 0, 0, 0, 0,
89, 0, 0, 89, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 29, 30, 31, 32, 27, 0, 33,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 0, 0, 0, 0, 0, 0, 0, 85, 78,
83, 87, 0, 0, 0, 0, 0, 0, 144, 145,
126, 0, 127, 113, 148, 149, 0, 1, 4, 75,
11, 0, 102, 12, 0, 108, 109, 16, 17, 111,
112, 14, 15, 13, 10, 8, 5, 6, 7, 9,
18, 20, 19, 23, 24, 21, 22, 2, 114, 157,
61, 0, 0, 0, 0, 0, 0, 0, 86, 79,
84, 88, 0, 0, 0, 0, 0, 0, 146, 147,
127, 0, 128, 114, 150, 151, 0, 1, 4, 76,
11, 0, 103, 12, 0, 109, 110, 16, 17, 112,
113, 14, 15, 13, 10, 8, 5, 6, 7, 9,
18, 20, 19, 23, 24, 21, 22, 2, 115, 159,
0, 48, 0, 38, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 75, 0,
0, 0, 72, 0, 0, 0, 100, 0, 110, 0,
146, 0, 72, 62, 76, 0, 75, 0, 89, 0,
158, 0, 49, 50, 39, 46, 47, 43, 44, 45,
25, 118, 40, 41, 42, 35, 34, 36, 37, 0,
0, 0, 0, 0, 73, 86, 84, 70, 88, 0,
0, 104, 107, 0, 0, 128, 63, 0, 66, 0,
0, 0, 0, 0, 0, 0, 0, 0, 26, 116,
120, 0, 28, 0, 81, 0, 79, 0, 0, 0,
90, 0, 0, 0, 0, 130, 0, 0, 0, 0,
77, 101, 106, 153, 154, 150, 151, 152, 155, 156,
161, 159, 119, 0, 117, 0, 122, 80, 74, 71,
0, 92, 0, 103, 105, 132, 138, 0, 0, 65,
64, 0, 162, 165, 0, 121, 91, 0, 97, 0,
0, 134, 139, 140, 131, 0, 0, 0, 163, 166,
0, 115, 93, 0, 99, 0, 0, 135, 136, 0,
160, 0, 0, 167, 0, 0, 133, 0, 129, 141,
0, 0, 0, 94, 123, 137, 147, 0, 0, 168,
95, 96, 98, 142, 0, 164
0, 0, 0, 0, 0, 0, 0, 0, 76, 0,
0, 0, 73, 0, 0, 0, 101, 0, 111, 0,
148, 0, 73, 62, 77, 0, 76, 0, 90, 0,
160, 0, 49, 50, 39, 46, 47, 43, 44, 45,
25, 119, 40, 41, 42, 35, 34, 36, 37, 0,
0, 0, 0, 0, 74, 87, 85, 71, 89, 0,
0, 105, 108, 0, 0, 74, 130, 129, 63, 0,
66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
26, 117, 121, 0, 28, 0, 82, 0, 80, 0,
0, 0, 91, 0, 0, 0, 0, 132, 0, 0,
0, 0, 0, 78, 102, 107, 155, 156, 152, 153,
154, 157, 158, 163, 161, 120, 0, 118, 0, 123,
81, 75, 72, 0, 93, 0, 104, 106, 134, 140,
0, 0, 70, 65, 64, 0, 164, 170, 0, 122,
92, 0, 98, 0, 0, 136, 141, 142, 133, 0,
0, 0, 165, 168, 169, 171, 0, 116, 94, 0,
100, 0, 0, 137, 138, 0, 162, 0, 0, 0,
172, 0, 0, 135, 0, 131, 143, 0, 0, 0,
0, 95, 124, 139, 149, 0, 0, 167, 173, 96,
97, 99, 144, 0, 166
};
/* YYDEFGOTO[NTERM-NUM]. */
static const short int yydefgoto[] =
{
-1, 180, 181, 164, 74, 207, 24, 25, 26, 198,
195, 165, 80, 81, 82, 105, 261, 278, 322, 294,
27, 28, 29, 201, 202, 106, 30, 31, 32, 33,
34, 35, 36, 37, 219, 220, 221, 38, 39, 40,
41, 42, 43, 44, 45, 235, 236, 281, 298, 308,
283, 46, 310, 89, 161, 47, 48, 49, 248, 170,
171, 272, 273, 289, 290, 50
-1, 180, 181, 164, 74, 209, 24, 25, 26, 206,
198, 195, 165, 80, 81, 82, 105, 264, 282, 331,
300, 27, 28, 29, 201, 202, 106, 30, 31, 32,
33, 34, 35, 36, 37, 221, 222, 223, 38, 39,
40, 41, 42, 43, 44, 45, 237, 238, 285, 304,
315, 287, 46, 317, 89, 161, 47, 48, 49, 251,
170, 171, 276, 277, 293, 294, 295, 296, 50
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -206
#define YYPACT_NINF -196
static const short int yypact[] =
{
423, -38, 13, 561, 561, -206, 122, 21, -13, 25,
1, -42, 35, 49, 52, -206, -206, -206, 40, -8,
-3, -206, 78, 86, -206, -12, -9, -4, -16, 3,
58, 12, 31, 58, 32, 34, 48, 51, 56, 59,
67, 68, 72, 73, 74, 75, 76, 79, 80, 81,
83, 561, 24, -206, -206, -206, -206, 17, 561, 41,
-206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
-206, 561, 561, 267, 77, 521, 84, 85, -206, 596,
-206, -39, 114, 153, 176, 135, 181, 182, -206, 132,
-206, 149, -206, -206, -206, -206, 102, -206, -206, 561,
-206, 103, -206, -206, 510, -206, -206, -206, -206, -206,
-206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
-206, -206, -206, -206, -206, -206, -206, -206, 596, 199,
138, 14, 140, 197, 69, 561, 561, 561, 561, 561,
423, 561, 561, 561, 561, 561, 561, 561, 561, 423,
561, -30, 204, 476, 205, 561, -206, 206, -206, 118,
-206, 157, 204, 117, 596, -82, 561, 166, 596, 46,
-206, -50, -206, -206, -206, 14, 14, 5, 5, 596,
-206, 8, 5, 5, 5, 18, 18, 197, 197, -49,
218, 225, 214, 123, -206, 120, -206, -206, -31, 587,
136, -206, 125, 222, 228, 120, -206, 15, -206, 561,
16, 232, 26, 26, 217, 199, 423, 561, -206, -206,
212, 220, -206, 216, -206, 141, -206, 240, 561, 241,
215, 561, 561, 206, 26, -206, 19, 192, 150, 154,
596, -206, -206, -206, -206, -206, -206, -206, -206, -206,
251, -206, 423, 328, -206, 233, -206, -206, -206, -206,
210, 221, 611, 596, -206, 161, 203, 222, 257, -206,
-206, 26, -206, 6, 423, -206, -206, 224, 226, 423,
264, 183, -206, -206, -206, 172, 175, 213, -206, -206,
-14, 423, -206, 237, -206, 299, 186, -206, 272, 276,
-206, 281, 423, -206, 282, 260, -206, 286, -206, -206,
20, 273, 361, 22, -206, -206, -206, 290, 40, -206,
-206, -206, -206, -206, 201, -206
384, -31, 32, 522, 522, -196, 121, 36, 7, 39,
12, -11, 52, 59, 77, -196, -196, -196, 40, 42,
46, -196, 82, 95, -196, 47, 38, 50, -5, 51,
132, 71, 72, 132, 73, 74, 75, 76, 78, 80,
83, 84, 85, 87, 88, 89, 96, 101, 105, 106,
108, 522, 81, -196, -196, -196, -196, 112, 522, 113,
-196, -196, -196, -196, -196, -196, -196, -196, -196, -196,
-196, 522, 522, 485, 115, 555, 118, 122, -196, 606,
-196, -41, 140, 192, 206, 163, 217, 218, -196, 171,
-196, 183, -196, -196, -196, -196, 134, -196, -196, 522,
-196, 135, -196, -196, 471, -196, -196, -196, -196, -196,
-196, -196, -196, -196, -196, -196, -196, -196, -196, -196,
-196, -196, -196, -196, -196, -196, -196, -196, 606, 230,
169, 24, 170, 227, 5, 522, 522, 522, 522, 522,
384, 522, 522, 522, 522, 522, 522, 522, 522, 384,
522, -13, 234, 437, 236, 522, -196, 237, -196, 145,
-196, 191, 242, 148, 606, -50, 522, 198, 606, 107,
-196, -44, -196, -196, -196, 24, 24, -3, -3, 606,
-196, 1, -3, -3, -3, 8, 8, 227, 227, -40,
195, 66, 246, 152, -196, 153, -196, -196, -32, 548,
165, -196, 154, 252, 253, 164, -196, 153, -196, 10,
-196, 522, 28, 257, 91, 91, 243, 230, 384, 522,
-196, -196, 239, 244, -196, 241, -196, 175, -196, 265,
522, 266, 248, 522, 522, 237, 91, -196, 62, 221,
176, 177, 185, 606, -196, -196, -196, -196, -196, -196,
-196, -196, -196, 282, -196, 384, 562, -196, 264, -196,
-196, -196, -196, 245, 255, 598, 606, -196, 193, 238,
252, 295, -196, -196, -196, 91, -196, 2, 384, -196,
-196, 261, 262, 384, 301, 220, -196, -196, -196, 205,
211, -52, -196, -196, -196, -196, -2, 384, -196, 269,
-196, 260, 212, -196, 306, 310, -196, 311, 312, 384,
-196, 314, 292, -196, 317, -196, -196, 63, 302, 224,
322, -20, -196, -196, -196, 323, 40, -196, -196, -196,
-196, -196, -196, 231, -196
};
/* YYPGOTO[NTERM-NUM]. */
static const short int yypgoto[] =
{
-206, 0, -126, -1, -206, -206, -206, -206, -206, -206,
143, -136, 155, -206, -206, -29, -206, -206, -206, -206,
-17, -206, -206, 90, -206, 277, -206, -206, -206, -206,
-206, -206, -206, -206, 89, -206, -206, -206, -206, -206,
-206, -206, -206, -206, -206, 44, -206, -206, -206, -206,
-206, -206, -206, -206, -206, -206, -206, -206, -205, 99,
-206, 54, -206, 38, -206, -206
-196, 0, -130, -1, -196, -196, -196, -196, -196, -196,
-196, 172, -124, 179, -196, -196, -29, -196, -196, -196,
-196, -17, -196, -196, 98, -196, 304, -196, -196, -196,
-196, -196, -196, -196, -196, 116, -196, -196, -196, -196,
-196, -196, -196, -196, -196, -196, 69, -196, -196, -196,
-196, -196, -196, -196, -196, -196, -196, -196, -196, -195,
125, -196, 79, -196, -196, -196, 54, -196, -196
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
......@@ -786,152 +798,152 @@ static const short int yypgoto[] =
#define YYTABLE_NINF -1
static const unsigned short int yytable[] =
{
23, 93, 73, 75, 109, 79, 192, 228, 249, 152,
302, 102, 189, 271, 87, 1, 88, 6, 139, 208,
52, 209, 2, 190, 51, 137, 138, 139, 83, 265,
210, 139, 85, 101, 3, 84, 216, 217, 86, 4,
5, 6, 90, 243, 244, 245, 246, 7, 247, 287,
128, 214, 222, 215, 209, 8, 91, 131, 9, 92,
10, 212, 213, 11, 153, 193, 286, 320, 321, 287,
133, 134, 229, 6, 12, 13, 14, 135, 136, 94,
137, 138, 139, 15, 95, 96, 97, 98, 16, 17,
252, 99, 18, 19, 20, 100, 104, 21, 144, 145,
146, 147, 103, 168, 141, 142, 143, 144, 145, 146,
147, 107, 22, 146, 147, 130, 238, 241, 239, 209,
266, 316, 267, 317, 129, 53, 54, 55, 56, 57,
108, 111, 58, 112, 175, 176, 177, 178, 179, 132,
182, 183, 184, 185, 186, 187, 188, 113, 291, 191,
114, 154, 79, 295, 199, 115, 76, 77, 116, 141,
142, 143, 144, 145, 146, 147, 117, 118, 155, 230,
174, 119, 120, 121, 122, 123, 312, 148, 124, 125,
126, 218, 127, 156, 150, 151, 157, 59, 158, 159,
218, 160, 60, 61, 62, 63, 64, 162, 65, 66,
67, 68, 163, 166, 69, 70, 169, 172, 240, 173,
139, 194, 197, 200, 204, 71, 253, 78, 203, 206,
211, 225, 72, 227, 226, 1, 232, 168, 233, 234,
262, 263, 2, 135, 136, 237, 137, 138, 139, 242,
250, 217, 257, 223, 3, 255, 256, 258, 259, 4,
5, 6, 218, 268, 260, 269, 270, 7, 271, 275,
276, 280, 277, 282, 285, 8, 292, 296, 9, 293,
10, 297, 299, 11, 300, 135, 136, 301, 137, 138,
139, 304, 307, 309, 12, 13, 14, 306, 311, 313,
314, 218, 315, 15, 140, 218, 318, 323, 16, 17,
325, 324, 18, 19, 20, 205, 1, 21, 196, 254,
110, 284, 218, 2, 251, 141, 142, 143, 144, 145,
146, 147, 22, 264, 305, 3, 224, 288, 303, 0,
4, 5, 6, 0, 0, 0, 135, 136, 7, 137,
138, 139, 0, 0, 0, 0, 8, 0, 0, 9,
0, 10, 0, 0, 11, 274, 0, 141, 142, 143,
144, 145, 146, 147, 0, 12, 13, 14, 1, 0,
0, 0, 0, 0, 15, 2, 0, 0, 0, 16,
17, 0, 0, 18, 19, 20, 319, 3, 21, 0,
0, 0, 4, 5, 6, 0, 0, 0, 0, 0,
7, 0, 0, 22, 0, 0, 0, 0, 8, 0,
0, 9, 0, 10, 0, 0, 11, 0, 141, 142,
143, 144, 145, 146, 147, 0, 0, 12, 13, 14,
1, 0, 0, 0, 0, 0, 15, 2, 0, 0,
0, 16, 17, 0, 0, 18, 19, 20, 0, 3,
21, 0, 0, 0, 4, 5, 6, 0, 0, 0,
0, 0, 7, 0, 0, 22, 0, 0, 0, 0,
8, 0, 0, 9, 0, 10, 0, 0, 11, 53,
54, 55, 56, 57, 0, 0, 58, 0, 0, 12,
13, 14, 0, 0, 0, 0, 0, 0, 15, 0,
0, 0, 0, 16, 17, 0, 0, 18, 19, 20,
76, 77, 21, 53, 54, 55, 56, 57, 0, 0,
58, 0, 0, 0, 0, 0, 0, 22, 0, 135,
136, 0, 137, 138, 139, 0, 0, 0, 0, 0,
0, 59, 0, 0, 0, 0, 60, 61, 62, 63,
64, 149, 65, 66, 67, 68, 0, 0, 69, 70,
0, 0, 0, 167, 53, 54, 55, 56, 57, 71,
0, 58, 0, 0, 0, 59, 72, 0, 0, 0,
60, 61, 62, 63, 64, 0, 65, 66, 67, 68,
0, 0, 69, 70, 0, 135, 136, 0, 137, 138,
139, 0, 0, 71, 135, 136, 0, 137, 138, 139,
72, 141, 142, 143, 144, 145, 146, 147, 0, 135,
136, 0, 137, 138, 139, 0, 59, 231, 0, 0,
23, 93, 73, 75, 109, 79, 230, 152, 1, 275,
139, 102, 307, 135, 136, 2, 137, 138, 139, 190,
252, 139, 309, 192, 189, 329, 330, 3, 6, 218,
219, 51, 4, 5, 6, 137, 138, 139, 308, 52,
7, 268, 212, 83, 101, 87, 85, 88, 8, 86,
128, 9, 210, 10, 211, 84, 11, 131, 216, 90,
217, 291, 224, 153, 211, 291, 91, 12, 13, 14,
133, 134, 231, 6, 135, 136, 15, 137, 138, 139,
290, 16, 17, 193, 92, 18, 19, 20, 255, 96,
21, 144, 145, 146, 147, 97, 141, 142, 143, 144,
145, 146, 147, 168, 146, 147, 22, 174, 246, 247,
248, 249, 241, 250, 242, 141, 142, 143, 144, 145,
146, 147, 214, 215, 53, 54, 55, 56, 57, 94,
244, 58, 211, 95, 175, 176, 177, 178, 179, 99,
182, 183, 184, 185, 186, 187, 188, 98, 297, 191,
100, 103, 79, 301, 199, 76, 77, 141, 142, 143,
144, 145, 146, 147, 269, 324, 270, 325, 226, 232,
104, 107, 108, 111, 112, 113, 114, 154, 115, 320,
116, 220, 129, 117, 118, 119, 59, 120, 121, 122,
220, 60, 61, 62, 63, 64, 123, 65, 66, 67,
68, 124, 1, 69, 70, 125, 126, 155, 127, 2,
243, 130, 132, 156, 157, 71, 148, 78, 256, 150,
225, 3, 72, 151, 158, 159, 4, 5, 6, 168,
160, 162, 265, 266, 7, 163, 166, 169, 172, 173,
139, 194, 8, 197, 200, 9, 203, 10, 204, 205,
11, 208, 213, 227, 228, 220, 234, 229, 235, 236,
239, 12, 13, 14, 245, 240, 253, 1, 219, 258,
15, 259, 261, 262, 2, 16, 17, 260, 272, 18,
19, 20, 271, 273, 21, 312, 3, 263, 274, 275,
279, 4, 5, 6, 284, 280, 281, 220, 286, 7,
22, 220, 289, 298, 302, 299, 305, 8, 303, 333,
9, 306, 10, 311, 313, 11, 314, 316, 318, 319,
220, 321, 322, 323, 327, 326, 12, 13, 14, 1,
332, 334, 196, 267, 207, 15, 2, 110, 257, 288,
16, 17, 254, 0, 18, 19, 20, 328, 3, 21,
310, 0, 0, 4, 5, 6, 292, 0, 0, 0,
0, 7, 0, 0, 0, 22, 0, 0, 0, 8,
0, 0, 9, 0, 10, 0, 0, 11, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
14, 1, 0, 0, 0, 0, 0, 15, 2, 0,
0, 0, 16, 17, 0, 0, 18, 19, 20, 0,
3, 21, 0, 0, 0, 4, 5, 6, 0, 0,
0, 0, 0, 7, 0, 0, 0, 22, 0, 0,
0, 8, 0, 0, 9, 0, 10, 0, 0, 11,
53, 54, 55, 56, 57, 0, 0, 58, 0, 0,
12, 13, 14, 0, 0, 0, 0, 0, 0, 15,
0, 0, 0, 0, 16, 17, 0, 0, 18, 19,
20, 76, 77, 21, 53, 54, 55, 56, 57, 0,
0, 58, 0, 0, 0, 0, 0, 0, 0, 22,
0, 0, 0, 135, 136, 0, 137, 138, 139, 0,
0, 0, 59, 0, 0, 0, 0, 60, 61, 62,
63, 64, 140, 65, 66, 67, 68, 0, 0, 69,
70, 0, 0, 0, 167, 53, 54, 55, 56, 57,
0, 71, 58, 0, 0, 0, 59, 0, 72, 0,
0, 60, 61, 62, 63, 64, 0, 65, 66, 67,
68, 279, 0, 69, 70, 0, 0, 0, 0, 0,
0, 0, 0, 0, 71, 0, 0, 0, 0, 0,
0, 72, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 141, 142, 143,
144, 145, 146, 147, 0, 0, 141, 142, 143, 144,
145, 146, 147, 0, 0, 0, 0, 0, 0, 0,
0, 141, 142, 143, 144, 145, 146, 147
68, 0, 0, 69, 70, 0, 135, 136, 0, 137,
138, 139, 0, 135, 136, 71, 137, 138, 139, 0,
135, 136, 72, 137, 138, 139, 141, 142, 143, 144,
145, 146, 147, 0, 0, 149, 0, 59, 233, 278,
0, 0, 60, 61, 62, 63, 64, 0, 65, 66,
67, 68, 0, 0, 69, 70, 135, 136, 0, 137,
138, 139, 0, 0, 135, 136, 71, 137, 138, 139,
0, 0, 0, 72, 0, 0, 0, 0, 283, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 141,
142, 143, 144, 145, 146, 147, 141, 142, 143, 144,
145, 146, 147, 141, 142, 143, 144, 145, 146, 147,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 141,
142, 143, 144, 145, 146, 147, 0, 141, 142, 143,
144, 145, 146, 147
};
static const short int yycheck[] =
{
0, 18, 3, 4, 33, 6, 36, 38, 213, 48,
24, 28, 148, 7, 56, 7, 58, 33, 13, 101,
7, 103, 14, 149, 62, 11, 12, 13, 7, 234,
166, 13, 7, 49, 26, 48, 28, 29, 37, 31,
32, 33, 7, 17, 18, 19, 20, 39, 22, 63,
51, 101, 101, 103, 103, 47, 7, 58, 50, 7,
52, 15, 16, 55, 103, 95, 271, 45, 46, 63,
71, 72, 103, 33, 66, 67, 68, 8, 9, 87,
11, 12, 13, 75, 87, 7, 0, 99, 80, 81,
216, 100, 84, 85, 86, 99, 38, 89, 93, 94,
95, 96, 99, 104, 90, 91, 92, 93, 94, 95,
96, 99, 104, 95, 96, 98, 101, 101, 103, 103,
101, 101, 103, 103, 100, 3, 4, 5, 6, 7,
99, 99, 10, 99, 135, 136, 137, 138, 139, 98,
141, 142, 143, 144, 145, 146, 147, 99, 274, 150,
99, 37, 153, 279, 155, 99, 34, 35, 99, 90,
91, 92, 93, 94, 95, 96, 99, 99, 15, 198,
101, 99, 99, 99, 99, 99, 302, 100, 99, 99,
99, 181, 99, 7, 100, 100, 51, 65, 7, 7,
190, 59, 70, 71, 72, 73, 74, 48, 76, 77,
78, 79, 100, 100, 82, 83, 7, 69, 209, 69,
13, 7, 7, 7, 57, 93, 217, 95, 100, 102,
54, 7, 100, 103, 101, 7, 90, 228, 103, 7,
231, 232, 14, 8, 9, 7, 11, 12, 13, 7,
23, 29, 101, 25, 26, 25, 30, 7, 7, 31,
32, 33, 252, 61, 39, 105, 102, 39, 7, 26,
50, 100, 41, 60, 7, 47, 42, 3, 50, 43,
52, 88, 100, 55, 99, 8, 9, 64, 11, 12,
13, 44, 10, 7, 66, 67, 68, 101, 7, 7,
30, 291, 6, 75, 27, 295, 23, 7, 80, 81,
99, 318, 84, 85, 86, 162, 7, 89, 153, 220,
33, 267, 312, 14, 215, 90, 91, 92, 93, 94,
95, 96, 104, 233, 25, 26, 101, 273, 290, -1,
31, 32, 33, -1, -1, -1, 8, 9, 39, 11,
12, 13, -1, -1, -1, -1, 47, -1, -1, 50,
-1, 52, -1, -1, 55, 27, -1, 90, 91, 92,
93, 94, 95, 96, -1, 66, 67, 68, 7, -1,
-1, -1, -1, -1, 75, 14, -1, -1, -1, 80,
81, -1, -1, 84, 85, 86, 25, 26, 89, -1,
-1, -1, 31, 32, 33, -1, -1, -1, -1, -1,
39, -1, -1, 104, -1, -1, -1, -1, 47, -1,
-1, 50, -1, 52, -1, -1, 55, -1, 90, 91,
92, 93, 94, 95, 96, -1, -1, 66, 67, 68,
7, -1, -1, -1, -1, -1, 75, 14, -1, -1,
-1, 80, 81, -1, -1, 84, 85, 86, -1, 26,
89, -1, -1, -1, 31, 32, 33, -1, -1, -1,
-1, -1, 39, -1, -1, 104, -1, -1, -1, -1,
47, -1, -1, 50, -1, 52, -1, -1, 55, 3,
4, 5, 6, 7, -1, -1, 10, -1, -1, 66,
67, 68, -1, -1, -1, -1, -1, -1, 75, -1,
-1, -1, -1, 80, 81, -1, -1, 84, 85, 86,
34, 35, 89, 3, 4, 5, 6, 7, -1, -1,
10, -1, -1, -1, -1, -1, -1, 104, -1, 8,
9, -1, 11, 12, 13, -1, -1, -1, -1, -1,
-1, 65, -1, -1, -1, -1, 70, 71, 72, 73,
74, 30, 76, 77, 78, 79, -1, -1, 82, 83,
-1, -1, -1, 53, 3, 4, 5, 6, 7, 93,
-1, 10, -1, -1, -1, 65, 100, -1, -1, -1,
70, 71, 72, 73, 74, -1, 76, 77, 78, 79,
-1, -1, 82, 83, -1, 8, 9, -1, 11, 12,
13, -1, -1, 93, 8, 9, -1, 11, 12, 13,
100, 90, 91, 92, 93, 94, 95, 96, -1, 8,
9, -1, 11, 12, 13, -1, 65, 40, -1, -1,
0, 18, 3, 4, 33, 6, 38, 48, 7, 7,
13, 28, 64, 8, 9, 14, 11, 12, 13, 149,
215, 13, 24, 36, 148, 45, 46, 26, 33, 28,
29, 62, 31, 32, 33, 11, 12, 13, 90, 7,
39, 236, 166, 7, 49, 56, 7, 58, 47, 37,
51, 50, 102, 52, 104, 48, 55, 58, 102, 7,
104, 63, 102, 104, 104, 63, 7, 66, 67, 68,
71, 72, 104, 33, 8, 9, 75, 11, 12, 13,
275, 80, 81, 96, 7, 84, 85, 86, 218, 7,
89, 94, 95, 96, 97, 0, 91, 92, 93, 94,
95, 96, 97, 104, 96, 97, 105, 102, 17, 18,
19, 20, 102, 22, 104, 91, 92, 93, 94, 95,
96, 97, 15, 16, 3, 4, 5, 6, 7, 87,
102, 10, 104, 87, 135, 136, 137, 138, 139, 101,
141, 142, 143, 144, 145, 146, 147, 100, 278, 150,
100, 100, 153, 283, 155, 34, 35, 91, 92, 93,
94, 95, 96, 97, 102, 102, 104, 104, 102, 198,
38, 100, 100, 100, 100, 100, 100, 37, 100, 309,
100, 181, 101, 100, 100, 100, 65, 100, 100, 100,
190, 70, 71, 72, 73, 74, 100, 76, 77, 78,
79, 100, 7, 82, 83, 100, 100, 15, 100, 14,
211, 99, 99, 7, 51, 94, 101, 96, 219, 101,
25, 26, 101, 101, 7, 7, 31, 32, 33, 230,
59, 48, 233, 234, 39, 101, 101, 7, 69, 69,
13, 7, 47, 7, 7, 50, 101, 52, 57, 7,
55, 103, 54, 7, 102, 255, 91, 104, 104, 7,
7, 66, 67, 68, 7, 101, 23, 7, 29, 25,
75, 30, 7, 7, 14, 80, 81, 102, 102, 84,
85, 86, 61, 106, 89, 25, 26, 39, 103, 7,
26, 31, 32, 33, 101, 50, 41, 297, 60, 39,
105, 301, 7, 42, 3, 43, 101, 47, 88, 326,
50, 100, 52, 44, 102, 55, 10, 7, 7, 7,
320, 7, 30, 6, 100, 23, 66, 67, 68, 7,
7, 100, 153, 235, 162, 75, 14, 33, 222, 270,
80, 81, 217, -1, 84, 85, 86, 25, 26, 89,
296, -1, -1, 31, 32, 33, 277, -1, -1, -1,
-1, 39, -1, -1, -1, 105, -1, -1, -1, 47,
-1, -1, 50, -1, 52, -1, -1, 55, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 66, 67,
68, 7, -1, -1, -1, -1, -1, 75, 14, -1,
-1, -1, 80, 81, -1, -1, 84, 85, 86, -1,
26, 89, -1, -1, -1, 31, 32, 33, -1, -1,
-1, -1, -1, 39, -1, -1, -1, 105, -1, -1,
-1, 47, -1, -1, 50, -1, 52, -1, -1, 55,
3, 4, 5, 6, 7, -1, -1, 10, -1, -1,
66, 67, 68, -1, -1, -1, -1, -1, -1, 75,
-1, -1, -1, -1, 80, 81, -1, -1, 84, 85,
86, 34, 35, 89, 3, 4, 5, 6, 7, -1,
-1, 10, -1, -1, -1, -1, -1, -1, -1, 105,
-1, -1, -1, 8, 9, -1, 11, 12, 13, -1,
-1, -1, 65, -1, -1, -1, -1, 70, 71, 72,
73, 74, 27, 76, 77, 78, 79, -1, -1, 82,
83, -1, -1, -1, 53, 3, 4, 5, 6, 7,
-1, 94, 10, -1, -1, -1, 65, -1, 101, -1,
-1, 70, 71, 72, 73, 74, -1, 76, 77, 78,
79, 30, -1, 82, 83, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 93, -1, -1, -1, -1, -1,
-1, 100, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 90, 91, 92,
93, 94, 95, 96, -1, -1, 90, 91, 92, 93,
94, 95, 96, -1, -1, -1, -1, -1, -1, -1,
-1, 90, 91, 92, 93, 94, 95, 96
79, -1, -1, 82, 83, -1, 8, 9, -1, 11,
12, 13, -1, 8, 9, 94, 11, 12, 13, -1,
8, 9, 101, 11, 12, 13, 91, 92, 93, 94,
95, 96, 97, -1, -1, 30, -1, 65, 40, 27,
-1, -1, 70, 71, 72, 73, 74, -1, 76, 77,
78, 79, -1, -1, 82, 83, 8, 9, -1, 11,
12, 13, -1, -1, 8, 9, 94, 11, 12, 13,
-1, -1, -1, 101, -1, -1, -1, -1, 30, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
92, 93, 94, 95, 96, 97, 91, 92, 93, 94,
95, 96, 97, 91, 92, 93, 94, 95, 96, 97,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 91,
92, 93, 94, 95, 96, 97, -1, 91, 92, 93,
94, 95, 96, 97
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
......@@ -940,37 +952,38 @@ static const unsigned char yystos[] =
{
0, 7, 14, 26, 31, 32, 33, 39, 47, 50,
52, 55, 66, 67, 68, 75, 80, 81, 84, 85,
86, 89, 104, 107, 112, 113, 114, 126, 127, 128,
132, 133, 134, 135, 136, 137, 138, 139, 143, 144,
145, 146, 147, 148, 149, 150, 157, 161, 162, 163,
171, 62, 7, 3, 4, 5, 6, 7, 10, 65,
86, 89, 105, 108, 113, 114, 115, 128, 129, 130,
134, 135, 136, 137, 138, 139, 140, 141, 145, 146,
147, 148, 149, 150, 151, 152, 159, 163, 164, 165,
175, 62, 7, 3, 4, 5, 6, 7, 10, 65,
70, 71, 72, 73, 74, 76, 77, 78, 79, 82,
83, 93, 100, 109, 110, 109, 34, 35, 95, 109,
118, 119, 120, 7, 48, 7, 37, 56, 58, 159,
7, 7, 7, 126, 87, 87, 7, 0, 99, 100,
99, 49, 126, 99, 38, 121, 131, 99, 99, 121,
131, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 109, 100,
98, 109, 98, 109, 109, 8, 9, 11, 12, 13,
27, 90, 91, 92, 93, 94, 95, 96, 100, 30,
100, 100, 48, 103, 37, 15, 7, 51, 7, 7,
59, 160, 48, 100, 109, 117, 100, 53, 109, 7,
165, 166, 69, 69, 101, 109, 109, 109, 109, 109,
107, 108, 109, 109, 109, 109, 109, 109, 109, 117,
108, 109, 36, 95, 7, 116, 118, 7, 115, 109,
7, 129, 130, 100, 57, 116, 102, 111, 101, 103,
117, 54, 15, 16, 101, 103, 28, 29, 107, 140,
141, 142, 101, 25, 101, 7, 101, 103, 38, 103,
121, 40, 90, 103, 7, 151, 152, 7, 101, 103,
109, 101, 7, 17, 18, 19, 20, 22, 164, 164,
23, 165, 108, 109, 140, 25, 30, 101, 7, 7,
39, 122, 109, 109, 129, 164, 101, 103, 61, 105,
102, 7, 167, 168, 27, 26, 50, 41, 123, 30,
100, 153, 60, 156, 151, 7, 164, 63, 167, 169,
170, 108, 42, 43, 125, 108, 3, 88, 154, 100,
99, 64, 24, 169, 44, 25, 101, 10, 155, 7,
158, 7, 108, 7, 30, 6, 101, 103, 23, 25,
45, 46, 124, 7, 126, 99
83, 94, 101, 110, 111, 110, 34, 35, 96, 110,
120, 121, 122, 7, 48, 7, 37, 56, 58, 161,
7, 7, 7, 128, 87, 87, 7, 0, 100, 101,
100, 49, 128, 100, 38, 123, 133, 100, 100, 123,
133, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 110, 101,
99, 110, 99, 110, 110, 8, 9, 11, 12, 13,
27, 91, 92, 93, 94, 95, 96, 97, 101, 30,
101, 101, 48, 104, 37, 15, 7, 51, 7, 7,
59, 162, 48, 101, 110, 119, 101, 53, 110, 7,
167, 168, 69, 69, 102, 110, 110, 110, 110, 110,
108, 109, 110, 110, 110, 110, 110, 110, 110, 119,
109, 110, 36, 96, 7, 118, 120, 7, 117, 110,
7, 131, 132, 101, 57, 7, 116, 118, 103, 112,
102, 104, 119, 54, 15, 16, 102, 104, 28, 29,
108, 142, 143, 144, 102, 25, 102, 7, 102, 104,
38, 104, 123, 40, 91, 104, 7, 153, 154, 7,
101, 102, 104, 110, 102, 7, 17, 18, 19, 20,
22, 166, 166, 23, 167, 109, 110, 142, 25, 30,
102, 7, 7, 39, 124, 110, 110, 131, 166, 102,
104, 61, 102, 106, 103, 7, 169, 170, 27, 26,
50, 41, 125, 30, 101, 155, 60, 158, 153, 7,
166, 63, 169, 171, 172, 173, 174, 109, 42, 43,
127, 109, 3, 88, 156, 101, 100, 64, 90, 24,
173, 44, 25, 102, 10, 157, 7, 160, 7, 7,
109, 7, 30, 6, 102, 104, 23, 100, 25, 45,
46, 126, 7, 128, 100
};
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
......@@ -1582,270 +1595,275 @@ yyreduce:
switch (yyn)
{
case 25:
#line 159 "pars0grm.y"
#line 160 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 26:
#line 161 "pars0grm.y"
#line 162 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ;}
break;
case 27:
#line 165 "pars0grm.y"
#line 166 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 28:
#line 167 "pars0grm.y"
#line 168 "pars0grm.y"
{ yyval = pars_func(yyvsp[-3], yyvsp[-1]); ;}
break;
case 29:
#line 168 "pars0grm.y"
#line 169 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 30:
#line 169 "pars0grm.y"
#line 170 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 31:
#line 170 "pars0grm.y"
#line 171 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 32:
#line 171 "pars0grm.y"
#line 172 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 33:
#line 172 "pars0grm.y"
#line 173 "pars0grm.y"
{ yyval = yyvsp[0];;}
break;
case 34:
#line 173 "pars0grm.y"
#line 174 "pars0grm.y"
{ yyval = pars_op('+', yyvsp[-2], yyvsp[0]); ;}
break;
case 35:
#line 174 "pars0grm.y"
#line 175 "pars0grm.y"
{ yyval = pars_op('-', yyvsp[-2], yyvsp[0]); ;}
break;
case 36:
#line 175 "pars0grm.y"
#line 176 "pars0grm.y"
{ yyval = pars_op('*', yyvsp[-2], yyvsp[0]); ;}
break;
case 37:
#line 176 "pars0grm.y"
#line 177 "pars0grm.y"
{ yyval = pars_op('/', yyvsp[-2], yyvsp[0]); ;}
break;
case 38:
#line 177 "pars0grm.y"
#line 178 "pars0grm.y"
{ yyval = pars_op('-', yyvsp[0], NULL); ;}
break;
case 39:
#line 178 "pars0grm.y"
#line 179 "pars0grm.y"
{ yyval = yyvsp[-1]; ;}
break;
case 40:
#line 179 "pars0grm.y"
#line 180 "pars0grm.y"
{ yyval = pars_op('=', yyvsp[-2], yyvsp[0]); ;}
break;
case 41:
#line 180 "pars0grm.y"
#line 181 "pars0grm.y"
{ yyval = pars_op('<', yyvsp[-2], yyvsp[0]); ;}
break;
case 42:
#line 181 "pars0grm.y"
#line 182 "pars0grm.y"
{ yyval = pars_op('>', yyvsp[-2], yyvsp[0]); ;}
break;
case 43:
#line 182 "pars0grm.y"
#line 183 "pars0grm.y"
{ yyval = pars_op(PARS_GE_TOKEN, yyvsp[-2], yyvsp[0]); ;}
break;
case 44:
#line 183 "pars0grm.y"
#line 184 "pars0grm.y"
{ yyval = pars_op(PARS_LE_TOKEN, yyvsp[-2], yyvsp[0]); ;}
break;
case 45:
#line 184 "pars0grm.y"
#line 185 "pars0grm.y"
{ yyval = pars_op(PARS_NE_TOKEN, yyvsp[-2], yyvsp[0]); ;}
break;
case 46:
#line 185 "pars0grm.y"
#line 186 "pars0grm.y"
{ yyval = pars_op(PARS_AND_TOKEN, yyvsp[-2], yyvsp[0]); ;}
break;
case 47:
#line 186 "pars0grm.y"
#line 187 "pars0grm.y"
{ yyval = pars_op(PARS_OR_TOKEN, yyvsp[-2], yyvsp[0]); ;}
break;
case 48:
#line 187 "pars0grm.y"
#line 188 "pars0grm.y"
{ yyval = pars_op(PARS_NOT_TOKEN, yyvsp[0], NULL); ;}
break;
case 49:
#line 189 "pars0grm.y"
#line 190 "pars0grm.y"
{ yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ;}
break;
case 50:
#line 191 "pars0grm.y"
#line 192 "pars0grm.y"
{ yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ;}
break;
case 51:
#line 195 "pars0grm.y"
#line 196 "pars0grm.y"
{ yyval = &pars_to_char_token; ;}
break;
case 52:
#line 196 "pars0grm.y"
#line 197 "pars0grm.y"
{ yyval = &pars_to_number_token; ;}
break;
case 53:
#line 197 "pars0grm.y"
#line 198 "pars0grm.y"
{ yyval = &pars_to_binary_token; ;}
break;
case 54:
#line 199 "pars0grm.y"
#line 200 "pars0grm.y"
{ yyval = &pars_binary_to_number_token; ;}
break;
case 55:
#line 200 "pars0grm.y"
#line 201 "pars0grm.y"
{ yyval = &pars_substr_token; ;}
break;
case 56:
#line 201 "pars0grm.y"
#line 202 "pars0grm.y"
{ yyval = &pars_concat_token; ;}
break;
case 57:
#line 202 "pars0grm.y"
#line 203 "pars0grm.y"
{ yyval = &pars_instr_token; ;}
break;
case 58:
#line 203 "pars0grm.y"
#line 204 "pars0grm.y"
{ yyval = &pars_length_token; ;}
break;
case 59:
#line 204 "pars0grm.y"
#line 205 "pars0grm.y"
{ yyval = &pars_sysdate_token; ;}
break;
case 60:
#line 205 "pars0grm.y"
#line 206 "pars0grm.y"
{ yyval = &pars_rnd_token; ;}
break;
case 61:
#line 206 "pars0grm.y"
#line 207 "pars0grm.y"
{ yyval = &pars_rnd_str_token; ;}
break;
case 65:
#line 217 "pars0grm.y"
#line 218 "pars0grm.y"
{ yyval = pars_stored_procedure_call(yyvsp[-4]); ;}
break;
case 66:
#line 222 "pars0grm.y"
#line 223 "pars0grm.y"
{ yyval = pars_procedure_call(yyvsp[-3], yyvsp[-1]); ;}
break;
case 67:
#line 226 "pars0grm.y"
#line 227 "pars0grm.y"
{ yyval = &pars_replstr_token; ;}
break;
case 68:
#line 227 "pars0grm.y"
#line 228 "pars0grm.y"
{ yyval = &pars_printf_token; ;}
break;
case 69:
#line 228 "pars0grm.y"
#line 229 "pars0grm.y"
{ yyval = &pars_assert_token; ;}
break;
case 70:
#line 232 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 233 "pars0grm.y"
{ yyval = yyvsp[-2]; ;}
break;
case 71:
#line 234 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 237 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 72:
#line 238 "pars0grm.y"
{ yyval = NULL; ;}
#line 239 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 73:
#line 239 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 243 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 74:
#line 241 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 244 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 75:
#line 245 "pars0grm.y"
{ yyval = NULL; ;}
#line 246 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 76:
#line 246 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]);;}
#line 250 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 77:
#line 247 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 251 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]);;}
break;
case 78:
#line 251 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
#line 252 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 79:
#line 253 "pars0grm.y"
#line 256 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
break;
case 80:
#line 258 "pars0grm.y"
{ yyval = pars_func(&pars_count_token,
que_node_list_add_last(NULL,
sym_tab_add_int_lit(
pars_sym_tab_global, 1))); ;}
break;
case 80:
#line 258 "pars0grm.y"
case 81:
#line 263 "pars0grm.y"
{ yyval = pars_func(&pars_count_token,
que_node_list_add_last(NULL,
pars_func(&pars_distinct_token,
......@@ -1853,288 +1871,282 @@ yyreduce:
NULL, yyvsp[-1])))); ;}
break;
case 81:
#line 264 "pars0grm.y"
case 82:
#line 269 "pars0grm.y"
{ yyval = pars_func(&pars_sum_token,
que_node_list_add_last(NULL,
yyvsp[-1])); ;}
break;
case 82:
#line 270 "pars0grm.y"
case 83:
#line 275 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 83:
#line 271 "pars0grm.y"
case 84:
#line 276 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 84:
#line 273 "pars0grm.y"
case 85:
#line 278 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 85:
#line 277 "pars0grm.y"
case 86:
#line 282 "pars0grm.y"
{ yyval = pars_select_list(&pars_star_denoter,
NULL); ;}
break;
case 86:
#line 280 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[-2], yyvsp[0]); ;}
break;
case 87:
#line 281 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[0], NULL); ;}
#line 285 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[-2], yyvsp[0]); ;}
break;
case 88:
#line 285 "pars0grm.y"
{ yyval = NULL; ;}
#line 286 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[0], NULL); ;}
break;
case 89:
#line 286 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
#line 290 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 90:
#line 290 "pars0grm.y"
{ yyval = NULL; ;}
#line 291 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
break;
case 91:
#line 292 "pars0grm.y"
{ yyval = &pars_update_token; ;}
#line 295 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 92:
#line 296 "pars0grm.y"
{ yyval = NULL; ;}
#line 297 "pars0grm.y"
{ yyval = &pars_update_token; ;}
break;
case 93:
#line 298 "pars0grm.y"
{ yyval = &pars_consistent_token; ;}
#line 301 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 94:
#line 302 "pars0grm.y"
{ yyval = &pars_asc_token; ;}
#line 303 "pars0grm.y"
{ yyval = &pars_consistent_token; ;}
break;
case 95:
#line 303 "pars0grm.y"
#line 307 "pars0grm.y"
{ yyval = &pars_asc_token; ;}
break;
case 96:
#line 304 "pars0grm.y"
{ yyval = &pars_desc_token; ;}
#line 308 "pars0grm.y"
{ yyval = &pars_asc_token; ;}
break;
case 97:
#line 308 "pars0grm.y"
{ yyval = NULL; ;}
#line 309 "pars0grm.y"
{ yyval = &pars_desc_token; ;}
break;
case 98:
#line 310 "pars0grm.y"
{ yyval = pars_order_by(yyvsp[-1], yyvsp[0]); ;}
#line 313 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 99:
#line 319 "pars0grm.y"
{ yyval = pars_select_statement(yyvsp[-6], yyvsp[-4], yyvsp[-3],
yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
#line 315 "pars0grm.y"
{ yyval = pars_order_by(yyvsp[-1], yyvsp[0]); ;}
break;
case 100:
#line 325 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
#line 324 "pars0grm.y"
{ yyval = pars_select_statement(yyvsp[-6], yyvsp[-4], yyvsp[-3],
yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
break;
case 101:
#line 330 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-4], yyvsp[-1], NULL); ;}
{ yyval = yyvsp[0]; ;}
break;
case 102:
#line 332 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
#line 335 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-4], yyvsp[-1], NULL); ;}
break;
case 103:
#line 336 "pars0grm.y"
{ yyval = pars_column_assignment(yyvsp[-2], yyvsp[0]); ;}
#line 337 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
break;
case 104:
#line 340 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 341 "pars0grm.y"
{ yyval = pars_column_assignment(yyvsp[-2], yyvsp[0]); ;}
break;
case 105:
#line 342 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 345 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 106:
#line 348 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
#line 347 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 107:
#line 354 "pars0grm.y"
{ yyval = pars_update_statement_start(FALSE,
yyvsp[-2], yyvsp[0]); ;}
#line 353 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
break;
case 108:
#line 360 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
#line 359 "pars0grm.y"
{ yyval = pars_update_statement_start(FALSE,
yyvsp[-2], yyvsp[0]); ;}
break;
case 109:
#line 365 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;}
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
break;
case 110:
#line 370 "pars0grm.y"
{ yyval = pars_update_statement_start(TRUE,
yyvsp[0], NULL); ;}
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;}
break;
case 111:
#line 376 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
#line 375 "pars0grm.y"
{ yyval = pars_update_statement_start(TRUE,
yyvsp[0], NULL); ;}
break;
case 112:
#line 381 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;}
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;}
break;
case 113:
#line 386 "pars0grm.y"
{ yyval = pars_row_printf_statement(yyvsp[0]); ;}
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;}
break;
case 114:
#line 391 "pars0grm.y"
{ yyval = pars_assignment_statement(yyvsp[-2], yyvsp[0]); ;}
{ yyval = pars_row_printf_statement(yyvsp[0]); ;}
break;
case 115:
#line 397 "pars0grm.y"
{ yyval = pars_elsif_element(yyvsp[-2], yyvsp[0]); ;}
#line 396 "pars0grm.y"
{ yyval = pars_assignment_statement(yyvsp[-2], yyvsp[0]); ;}
break;
case 116:
#line 401 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 402 "pars0grm.y"
{ yyval = pars_elsif_element(yyvsp[-2], yyvsp[0]); ;}
break;
case 117:
#line 403 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ;}
#line 406 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 118:
#line 407 "pars0grm.y"
{ yyval = NULL; ;}
#line 408 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ;}
break;
case 119:
#line 409 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
#line 412 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 120:
#line 410 "pars0grm.y"
#line 414 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
break;
case 121:
#line 417 "pars0grm.y"
{ yyval = pars_if_statement(yyvsp[-5], yyvsp[-3], yyvsp[-2]); ;}
#line 415 "pars0grm.y"
{ yyval = yyvsp[0]; ;}
break;
case 122:
#line 423 "pars0grm.y"
{ yyval = pars_while_statement(yyvsp[-4], yyvsp[-2]); ;}
#line 422 "pars0grm.y"
{ yyval = pars_if_statement(yyvsp[-5], yyvsp[-3], yyvsp[-2]); ;}
break;
case 123:
#line 431 "pars0grm.y"
{ yyval = pars_for_statement(yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2]); ;}
#line 428 "pars0grm.y"
{ yyval = pars_while_statement(yyvsp[-4], yyvsp[-2]); ;}
break;
case 124:
#line 435 "pars0grm.y"
{ yyval = pars_exit_statement(); ;}
#line 436 "pars0grm.y"
{ yyval = pars_for_statement(yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2]); ;}
break;
case 125:
#line 439 "pars0grm.y"
{ yyval = pars_return_statement(); ;}
#line 440 "pars0grm.y"
{ yyval = pars_exit_statement(); ;}
break;
case 126:
#line 444 "pars0grm.y"
{ yyval = pars_open_statement(
ROW_SEL_OPEN_CURSOR, yyvsp[0]); ;}
{ yyval = pars_return_statement(); ;}
break;
case 127:
#line 450 "pars0grm.y"
#line 449 "pars0grm.y"
{ yyval = pars_open_statement(
ROW_SEL_CLOSE_CURSOR, yyvsp[0]); ;}
ROW_SEL_OPEN_CURSOR, yyvsp[0]); ;}
break;
case 128:
#line 456 "pars0grm.y"
{ yyval = pars_fetch_statement(yyvsp[-2], yyvsp[0]); ;}
#line 455 "pars0grm.y"
{ yyval = pars_open_statement(
ROW_SEL_CLOSE_CURSOR, yyvsp[0]); ;}
break;
case 129:
#line 461 "pars0grm.y"
{ yyval = pars_column_def(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
{ yyval = pars_fetch_statement(yyvsp[-2], yyvsp[0], NULL); ;}
break;
case 130:
#line 465 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 463 "pars0grm.y"
{ yyval = pars_fetch_statement(yyvsp[-2], NULL, yyvsp[0]); ;}
break;
case 131:
#line 467 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 468 "pars0grm.y"
{ yyval = pars_column_def(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
break;
case 132:
#line 471 "pars0grm.y"
{ yyval = NULL; ;}
#line 472 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 133:
#line 473 "pars0grm.y"
{ yyval = yyvsp[-1]; ;}
#line 474 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 134:
#line 477 "pars0grm.y"
#line 478 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 135:
#line 479 "pars0grm.y"
{ yyval = &pars_int_token;
/* pass any non-NULL pointer */ ;}
#line 480 "pars0grm.y"
{ yyval = yyvsp[-1]; ;}
break;
case 136:
......@@ -2160,119 +2172,135 @@ yyreduce:
break;
case 140:
#line 500 "pars0grm.y"
{ yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ;}
#line 498 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 141:
#line 504 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 500 "pars0grm.y"
{ yyval = &pars_int_token;
/* pass any non-NULL pointer */ ;}
break;
case 142:
#line 506 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 507 "pars0grm.y"
{ yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ;}
break;
case 143:
#line 510 "pars0grm.y"
{ yyval = NULL; ;}
#line 511 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 144:
#line 511 "pars0grm.y"
{ yyval = &pars_unique_token; ;}
#line 513 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 145:
#line 515 "pars0grm.y"
#line 517 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 146:
#line 516 "pars0grm.y"
{ yyval = &pars_clustered_token; ;}
#line 518 "pars0grm.y"
{ yyval = &pars_unique_token; ;}
break;
case 147:
#line 524 "pars0grm.y"
{ yyval = pars_create_index(yyvsp[-8], yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ;}
#line 522 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 148:
#line 529 "pars0grm.y"
{ yyval = pars_commit_statement(); ;}
#line 523 "pars0grm.y"
{ yyval = &pars_clustered_token; ;}
break;
case 149:
#line 534 "pars0grm.y"
{ yyval = pars_rollback_statement(); ;}
#line 531 "pars0grm.y"
{ yyval = pars_create_index(yyvsp[-8], yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ;}
break;
case 150:
#line 538 "pars0grm.y"
{ yyval = &pars_int_token; ;}
#line 536 "pars0grm.y"
{ yyval = pars_commit_statement(); ;}
break;
case 151:
#line 539 "pars0grm.y"
{ yyval = &pars_int_token; ;}
#line 541 "pars0grm.y"
{ yyval = pars_rollback_statement(); ;}
break;
case 152:
#line 540 "pars0grm.y"
{ yyval = &pars_char_token; ;}
#line 545 "pars0grm.y"
{ yyval = &pars_int_token; ;}
break;
case 153:
#line 541 "pars0grm.y"
{ yyval = &pars_binary_token; ;}
#line 546 "pars0grm.y"
{ yyval = &pars_int_token; ;}
break;
case 154:
#line 542 "pars0grm.y"
{ yyval = &pars_blob_token; ;}
#line 547 "pars0grm.y"
{ yyval = &pars_char_token; ;}
break;
case 155:
#line 547 "pars0grm.y"
#line 548 "pars0grm.y"
{ yyval = &pars_binary_token; ;}
break;
case 156:
#line 549 "pars0grm.y"
{ yyval = &pars_blob_token; ;}
break;
case 157:
#line 554 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_INPUT, yyvsp[0]); ;}
break;
case 156:
#line 550 "pars0grm.y"
case 158:
#line 557 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_OUTPUT, yyvsp[0]); ;}
break;
case 157:
#line 555 "pars0grm.y"
case 159:
#line 562 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 158:
#line 556 "pars0grm.y"
case 160:
#line 563 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 159:
#line 558 "pars0grm.y"
case 161:
#line 565 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 160:
#line 563 "pars0grm.y"
case 162:
#line 570 "pars0grm.y"
{ yyval = pars_variable_declaration(yyvsp[-2], yyvsp[-1]); ;}
break;
case 164:
#line 575 "pars0grm.y"
case 166:
#line 582 "pars0grm.y"
{ yyval = pars_cursor_declaration(yyvsp[-3], yyvsp[-1]); ;}
break;
case 168:
#line 591 "pars0grm.y"
case 167:
#line 587 "pars0grm.y"
{ yyval = pars_function_declaration(yyvsp[-1]); ;}
break;
case 173:
#line 608 "pars0grm.y"
{ yyval = pars_procedure_definition(yyvsp[-9], yyvsp[-7],
yyvsp[-1]); ;}
break;
......@@ -2281,7 +2309,7 @@ yyreduce:
}
/* Line 1010 of yacc.c. */
#line 2285 "pars0grm.tab.c"
#line 2313 "pars0grm.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
......@@ -2506,6 +2534,6 @@ yyreturn:
}
#line 595 "pars0grm.y"
#line 612 "pars0grm.y"
......@@ -116,7 +116,8 @@
PARS_WORK_TOKEN = 342,
PARS_UNSIGNED_TOKEN = 343,
PARS_EXIT_TOKEN = 344,
NEG = 345
PARS_FUNCTION_TOKEN = 345,
NEG = 346
};
#endif
#define PARS_INT_LIT 258
......@@ -206,7 +207,8 @@
#define PARS_WORK_TOKEN 342
#define PARS_UNSIGNED_TOKEN 343
#define PARS_EXIT_TOKEN 344
#define NEG 345
#define PARS_FUNCTION_TOKEN 345
#define NEG 346
......
......@@ -117,6 +117,7 @@ yylex(void);
%token PARS_WORK_TOKEN
%token PARS_UNSIGNED_TOKEN
%token PARS_EXIT_TOKEN
%token PARS_FUNCTION_TOKEN
%left PARS_AND_TOKEN PARS_OR_TOKEN
%left PARS_NOT_TOKEN
......@@ -228,6 +229,10 @@ predefined_procedure_name:
| PARS_ASSERT_TOKEN { $$ = &pars_assert_token; }
;
user_function_call:
PARS_ID_TOKEN '(' ')' { $$ = $1; }
;
table_list:
PARS_ID_TOKEN { $$ = que_node_list_add_last(NULL, $1); }
| table_list ',' PARS_ID_TOKEN
......@@ -453,7 +458,9 @@ close_cursor_statement:
fetch_statement:
PARS_FETCH_TOKEN PARS_ID_TOKEN PARS_INTO_TOKEN variable_list
{ $$ = pars_fetch_statement($2, $4); }
{ $$ = pars_fetch_statement($2, $4, NULL); }
| PARS_FETCH_TOKEN PARS_ID_TOKEN PARS_INTO_TOKEN user_function_call
{ $$ = pars_fetch_statement($2, NULL, $4); }
;
column_def:
......@@ -575,10 +582,20 @@ cursor_declaration:
{ $$ = pars_cursor_declaration($3, $5); }
;
function_declaration:
PARS_DECLARE_TOKEN PARS_FUNCTION_TOKEN PARS_ID_TOKEN ';'
{ $$ = pars_function_declaration($3); }
;
declaration:
cursor_declaration
| function_declaration
;
declaration_list:
/* Nothing */
| cursor_declaration
| declaration_list cursor_declaration
| declaration
| declaration_list declaration
;
procedure_definition:
......
......@@ -494,6 +494,10 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_EXIT_TOKEN);
}
"FUNCTION" {
return(PARS_FUNCTION_TOKEN);
}
{ID} {
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*)yytext,
......
......@@ -373,14 +373,15 @@ pars_resolve_exp_variables_and_types(
}
/* Not resolved yet: look in the symbol table for a variable
or a cursor with the same name */
or a cursor or a function with the same name */
node = UT_LIST_GET_FIRST(pars_sym_tab_global->sym_list);
while (node) {
if (node->resolved
&& ((node->token_type == SYM_VAR)
|| (node->token_type == SYM_CURSOR))
|| (node->token_type == SYM_CURSOR)
|| (node->token_type == SYM_FUNCTION))
&& node->name
&& (sym_node->name_len == node->name_len)
&& (ut_memcmp(sym_node->name, node->name,
......@@ -786,6 +787,26 @@ pars_cursor_declaration(
return(sym_node);
}
/*************************************************************************
Parses a function declaration. */
que_node_t*
pars_function_declaration(
/*======================*/
/* out: sym_node */
sym_node_t* sym_node) /* in: function id node in the symbol
table */
{
sym_node->resolved = TRUE;
sym_node->token_type = SYM_FUNCTION;
/* Check that the function exists. */
ut_a(pars_info_get_user_func(pars_sym_tab_global->info,
sym_node->name));
return(sym_node);
}
/*************************************************************************
Parses a delete or update statement start. */
......@@ -1433,26 +1454,42 @@ pars_procedure_call(
}
/*************************************************************************
Parses a fetch statement. */
Parses a fetch statement. into_list or user_func (but not both) must be
non-NULL. */
fetch_node_t*
pars_fetch_statement(
/*=================*/
/* out: fetch statement node */
sym_node_t* cursor, /* in: cursor node */
sym_node_t* into_list) /* in: variables to set */
sym_node_t* into_list, /* in: variables to set, or NULL */
sym_node_t* user_func) /* in: user function name, or NULL */
{
sym_node_t* cursor_decl;
fetch_node_t* node;
/* Logical XOR. */
ut_a(!into_list != !user_func);
node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(fetch_node_t));
node->common.type = QUE_NODE_FETCH;
pars_resolve_exp_variables_and_types(NULL, cursor);
pars_resolve_exp_list_variables_and_types(NULL, into_list);
if (into_list) {
pars_resolve_exp_list_variables_and_types(NULL, into_list);
node->into_list = into_list;
node->func = NULL;
} else {
pars_resolve_exp_variables_and_types(NULL, user_func);
node->func = pars_info_get_user_func(pars_sym_tab_global->info,
user_func->name);
ut_a(node->func);
node->into_list = NULL;
}
cursor_decl = cursor->alias;
......@@ -1460,8 +1497,11 @@ pars_fetch_statement(
node->cursor_def = cursor_decl->cursor_def;
if (into_list) {
ut_a(que_node_list_get_len(into_list)
== que_node_list_get_len(node->cursor_def->select_list));
== que_node_list_get_len(
node->cursor_def->select_list));
}
return(node);
}
......@@ -1822,6 +1862,7 @@ que_t*
pars_sql(
/*=====*/
/* out, own: the query graph */
pars_info_t* info, /* in: extra information, or NULL */
const char* str) /* in: SQL string */
{
sym_node_t* sym_node;
......@@ -1841,6 +1882,7 @@ pars_sql(
pars_sym_tab_global->sql_string = mem_heap_strdup(heap, str);
pars_sym_tab_global->string_len = strlen(str);
pars_sym_tab_global->next_char_pos = 0;
pars_sym_tab_global->info = info;
yyparse();
......@@ -1891,3 +1933,29 @@ pars_complete_graph_for_exec(
return(thr);
}
/********************************************************************
Get user function with the given name.*/
pars_user_func_t*
pars_info_get_user_func(
/*====================*/
/* out: user func, or NULL if not
found */
pars_info_t* info, /* in: info struct */
const char* name) /* in: function name to find*/
{
ulint i;
if (!info) {
return(NULL);
}
for (i = 0; i < info->n_funcs; i++) {
if (strcmp(info->funcs[i].name, name) == 0) {
return(&info->funcs[i]);
}
}
return(NULL);
}
......@@ -2510,7 +2510,7 @@ do not allow the discard. We also reserve the data dictionary latch. */
(ulong) ut_dulint_get_high(new_id),
(ulong) ut_dulint_get_low(new_id));
graph = pars_sql(buf);
graph = pars_sql(NULL, buf);
ut_a(graph);
......@@ -2942,7 +2942,7 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */
(ulong) ut_dulint_get_high(new_id),
(ulong) ut_dulint_get_low(new_id));
graph = pars_sql(sql);
graph = pars_sql(NULL, sql);
ut_a(graph);
......@@ -3166,7 +3166,7 @@ row_drop_table_for_mysql(
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
graph = pars_sql(sql);
graph = pars_sql(NULL, sql);
ut_a(graph);
mem_free(sql);
......@@ -3781,7 +3781,7 @@ row_rename_table_for_mysql(
ut_a(sqlend == sql + len + 1);
graph = pars_sql(sql);
graph = pars_sql(NULL, sql);
ut_a(graph);
mem_free(sql);
......
......@@ -1975,7 +1975,18 @@ fetch_step(
if (sel_node->state != SEL_NODE_NO_MORE_ROWS) {
sel_assign_into_var_values(node->into_list, sel_node);
if (node->into_list) {
sel_assign_into_var_values(node->into_list,
sel_node);
} else {
void* ret = (*node->func->func)(sel_node,
node->func->arg);
if (!ret) {
sel_node->state =
SEL_NODE_NO_MORE_ROWS;
}
}
}
thr->run_node = que_node_get_parent(node);
......@@ -2004,6 +2015,46 @@ fetch_step(
return(thr);
}
/********************************************************************
Sample callback function for fetch that prints each row.*/
void*
row_fetch_print(
/*============*/
/* out: always returns non-NULL */
void* row, /* in: sel_node_t* */
void* user_arg) /* in: not used */
{
sel_node_t* node = row;
que_node_t* exp;
ulint i = 0;
UT_NOT_USED(user_arg);
fprintf(stderr, "row_fetch_print: row %p\n", row);
exp = node->select_list;
while (exp) {
dfield_t* dfield = que_node_get_val(exp);
dtype_t* type = dfield_get_type(dfield);
fprintf(stderr, " column %lu:\n", (ulong)i);
dtype_print(type);
fprintf(stderr, "\n");
ut_print_buf(stderr, dfield_get_data(dfield),
dfield_get_len(dfield));
fprintf(stderr, "\n");
exp = que_node_get_next(exp);
i++;
}
return((void*)42);
}
/***************************************************************
Prints a row in a select result. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment