diff options
Diffstat (limited to 'storage/innobase/pars')
-rw-r--r-- | storage/innobase/pars/lexyy.cc (renamed from storage/innobase/pars/lexyy.c) | 1436 | ||||
-rwxr-xr-x | storage/innobase/pars/make_bison.sh | 14 | ||||
-rwxr-xr-x | storage/innobase/pars/make_flex.sh | 16 | ||||
-rw-r--r-- | storage/innobase/pars/pars0grm.c | 2601 | ||||
-rw-r--r-- | storage/innobase/pars/pars0grm.cc | 3034 | ||||
-rw-r--r-- | storage/innobase/pars/pars0grm.y | 189 | ||||
-rw-r--r-- | storage/innobase/pars/pars0lex.l | 66 | ||||
-rw-r--r-- | storage/innobase/pars/pars0opt.cc (renamed from storage/innobase/pars/pars0opt.c) | 143 | ||||
-rw-r--r-- | storage/innobase/pars/pars0pars.cc (renamed from storage/innobase/pars/pars0pars.c) | 741 | ||||
-rw-r--r-- | storage/innobase/pars/pars0sym.cc (renamed from storage/innobase/pars/pars0sym.c) | 139 |
10 files changed, 4847 insertions, 3532 deletions
diff --git a/storage/innobase/pars/lexyy.c b/storage/innobase/pars/lexyy.cc index 815395ea316..9de8ea51efd 100644 --- a/storage/innobase/pars/lexyy.c +++ b/storage/innobase/pars/lexyy.cc @@ -1,25 +1,7 @@ -/***************************************************************************** - -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA - -*****************************************************************************/ - #include "univ.i" -#line 2 "lexyy.c" +#line 2 "lexyy.cc" -#line 4 "lexyy.c" +#line 4 "lexyy.cc" #define YY_INT_ALIGNED short int @@ -28,7 +10,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 31 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -50,7 +32,15 @@ Place, Suite 330, Boston, MA 02111-1307 USA /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; @@ -62,7 +52,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -105,11 +95,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -154,21 +145,30 @@ typedef unsigned int flex_uint32_t; #define YY_BUF_SIZE 16384 #endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -static int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; -static FILE *yyin, *yyout; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -185,16 +185,6 @@ static FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -212,7 +202,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -235,7 +225,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -282,12 +272,12 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -static int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static char *yy_c_buf_p = (char*) 0; +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -295,13 +285,13 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -static void yyrestart (FILE *input_file ); +void yyrestart (FILE *input_file ); __attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -static void yy_delete_buffer (YY_BUFFER_STATE b ); -static void yy_flush_buffer (YY_BUFFER_STATE b ); -__attribute__((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -__attribute__((unused)) static void yypop_buffer_state (void ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); @@ -311,11 +301,11 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); -static void *yyalloc (yy_size_t ); -static void *yyrealloc (void *,yy_size_t ); -static void yyfree (void * ); +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer @@ -348,15 +338,15 @@ static void yyfree (void * ); typedef unsigned char YY_CHAR; -static FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = (FILE*) 0, *yyout = (FILE*) 0; typedef int yy_state_type; -static int yylineno; +extern int yylineno; -static int yylineno = 1; +int yylineno = 1; -static char *yytext; +extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); @@ -374,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 119 -#define YY_END_OF_BUFFER 120 +#define YY_NUM_RULES 124 +#define YY_END_OF_BUFFER 125 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -383,52 +373,55 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[399] = +static yyconst flex_int16_t yy_accept[424] = { 0, - 0, 0, 114, 114, 0, 0, 0, 0, 120, 118, - 117, 117, 8, 118, 109, 5, 98, 104, 107, 105, - 102, 106, 118, 108, 1, 118, 103, 101, 99, 100, - 112, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 110, 111, 114, 115, 6, 7, 9, 10, 117, 4, - 93, 113, 2, 1, 3, 94, 95, 97, 96, 92, - 92, 92, 92, 92, 92, 44, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 28, 17, 25, 92, 92, 92, 92, 92, - - 54, 61, 92, 14, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 114, 115, 115, 116, 6, 7, 9, 10, - 2, 13, 45, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 27, 92, 92, 92, 41, 92, 92, 92, 92, - 21, 92, 92, 92, 92, 15, 92, 92, 92, 18, - 92, 92, 92, 92, 92, 80, 92, 92, 92, 51, - 92, 12, 92, 36, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 20, 24, - - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 46, 92, 92, 30, 92, 87, 92, 92, 39, 92, - 92, 92, 92, 92, 48, 92, 89, 32, 91, 92, - 11, 64, 92, 92, 92, 42, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 29, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 85, 92, 26, 92, - 66, 92, 92, 92, 37, 92, 92, 92, 92, 92, - 92, 92, 31, 65, 23, 92, 57, 92, 75, 92, - 92, 92, 43, 92, 92, 92, 92, 92, 92, 92, - 92, 90, 92, 92, 56, 92, 92, 92, 92, 92, - - 92, 92, 40, 33, 79, 19, 92, 83, 74, 55, - 92, 63, 92, 52, 92, 92, 92, 47, 92, 76, - 92, 78, 92, 92, 34, 92, 92, 92, 35, 72, - 92, 92, 92, 92, 58, 92, 50, 49, 92, 92, - 53, 62, 92, 92, 92, 22, 92, 92, 73, 81, - 92, 92, 77, 92, 68, 92, 92, 92, 92, 38, - 92, 88, 67, 92, 84, 92, 92, 92, 86, 92, - 59, 92, 16, 92, 70, 69, 92, 92, 82, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 71, - 92, 92, 92, 92, 92, 92, 60, 0 - + 0, 0, 119, 119, 0, 0, 0, 0, 125, 123, + 122, 122, 8, 123, 114, 5, 103, 109, 112, 110, + 107, 111, 123, 113, 1, 123, 108, 106, 104, 105, + 117, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 115, 116, 119, 120, 6, 7, 9, 10, 122, 4, + 98, 118, 2, 1, 3, 99, 100, 102, 101, 0, + 96, 96, 96, 96, 96, 96, 44, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 28, 17, 25, 96, 96, 96, 96, + + 96, 96, 54, 63, 96, 14, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 119, 120, 120, 121, 6, 7, + 9, 10, 2, 0, 97, 13, 45, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 27, 96, 96, 96, + 41, 96, 96, 96, 96, 21, 96, 96, 96, 96, + 96, 15, 96, 96, 96, 18, 96, 96, 96, 96, + 96, 82, 96, 96, 96, 51, 96, 12, 96, 36, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + + 96, 0, 97, 96, 96, 96, 96, 20, 96, 24, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 46, 96, 96, 30, 96, 89, 96, 96, 39, + 96, 96, 96, 96, 96, 48, 96, 94, 91, 32, + 93, 96, 11, 66, 96, 96, 96, 42, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 29, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 87, 0, + 96, 26, 96, 96, 96, 68, 96, 96, 96, 96, + 37, 96, 96, 96, 96, 96, 96, 96, 31, 67, + 23, 96, 59, 96, 77, 96, 96, 96, 43, 96, + + 96, 96, 96, 96, 96, 96, 96, 92, 96, 96, + 56, 96, 96, 96, 96, 96, 96, 96, 40, 33, + 0, 81, 95, 19, 96, 96, 85, 96, 76, 55, + 96, 65, 96, 52, 96, 96, 96, 47, 96, 78, + 96, 80, 96, 96, 34, 96, 96, 96, 35, 74, + 96, 96, 96, 96, 60, 96, 50, 49, 96, 96, + 96, 57, 53, 64, 96, 96, 96, 22, 96, 96, + 75, 83, 96, 96, 79, 96, 70, 96, 96, 96, + 96, 96, 38, 96, 90, 69, 96, 86, 96, 96, + 96, 88, 96, 96, 61, 96, 16, 96, 72, 71, + + 96, 58, 96, 84, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 73, 96, 96, 96, 96, 96, + 96, 62, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -436,17 +429,17 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 1, 5, 6, 1, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, - 20, 21, 22, 1, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 32, - 1, 1, 1, 1, 48, 1, 32, 32, 32, 32, - - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 49, 1, 50, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 5, 6, 7, 1, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 18, 19, 20, + 21, 22, 23, 1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 1, 1, 1, 1, 50, 1, 33, 33, 33, 33, + + 33, 33, 33, 33, 33, 33, 33, 51, 33, 33, + 33, 33, 52, 33, 53, 33, 33, 33, 33, 33, + 33, 33, 54, 1, 55, 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, 1, 1, 1, 1, 1, 1, @@ -463,236 +456,335 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[51] = +static yyconst flex_int32_t yy_meta[56] = { 0, - 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, - 1, 1, 1, 1, 1, 5, 1, 1, 1, 6, - 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 1, 1 + 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, + 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, + 8, 1, 1, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 1, 1 } ; -static yyconst flex_int16_t yy_base[409] = +static yyconst flex_int16_t yy_base[436] = { 0, - 0, 0, 437, 436, 438, 437, 439, 438, 441, 448, - 49, 51, 448, 0, 448, 448, 448, 448, 448, 448, - 448, 448, 426, 429, 41, 418, 448, 38, 448, 417, - 448, 20, 33, 32, 46, 40, 44, 0, 54, 52, - 399, 48, 60, 395, 65, 67, 81, 27, 411, 75, - 448, 448, 0, 98, 0, 426, 0, 428, 113, 0, - 448, 448, 415, 54, 410, 448, 448, 448, 448, 0, - 403, 68, 399, 391, 389, 0, 402, 80, 84, 397, - 383, 96, 381, 394, 379, 393, 387, 375, 379, 375, - 377, 377, 0, 98, 0, 376, 97, 385, 368, 375, - - 0, 0, 381, 381, 364, 94, 103, 379, 98, 65, - 381, 369, 109, 361, 377, 373, 351, 97, 372, 363, - 115, 356, 0, 137, 138, 448, 0, 388, 0, 390, - 377, 0, 0, 365, 360, 367, 365, 348, 346, 345, - 350, 359, 347, 359, 95, 347, 353, 354, 336, 336, - 123, 0, 334, 350, 351, 0, 338, 347, 344, 122, - 124, 341, 336, 330, 340, 338, 331, 328, 336, 0, - 326, 336, 334, 325, 315, 309, 322, 307, 327, 0, - 313, 0, 311, 0, 325, 316, 313, 131, 309, 316, - 323, 302, 304, 309, 309, 301, 304, 299, 0, 0, - - 311, 295, 305, 312, 292, 291, 305, 294, 307, 287, - 0, 297, 279, 0, 298, 0, 295, 282, 0, 281, - 276, 281, 280, 290, 0, 276, 0, 0, 0, 280, - 0, 0, 276, 273, 287, 0, 272, 272, 270, 286, - 271, 283, 280, 264, 282, 277, 0, 272, 272, 258, - 257, 270, 256, 270, 269, 268, 0, 252, 0, 246, - 0, 265, 249, 248, 0, 262, 252, 247, 246, 258, - 248, 247, 0, 0, 0, 251, 0, 239, 0, 253, - 249, 235, 0, 249, 250, 233, 238, 231, 249, 231, - 228, 0, 229, 226, 0, 231, 243, 230, 237, 227, - - 235, 220, 0, 0, 0, 212, 219, 0, 0, 0, - 216, 0, 230, 0, 231, 218, 217, 0, 213, 0, - 216, 0, 208, 210, 0, 209, 223, 216, 0, 0, - 219, 222, 204, 219, 0, 215, 0, 0, 199, 213, - 0, 0, 197, 196, 201, 0, 210, 195, 0, 0, - 201, 197, 0, 192, 0, 204, 204, 192, 202, 0, - 179, 0, 0, 199, 0, 183, 177, 183, 0, 174, - 0, 193, 0, 192, 0, 0, 183, 187, 0, 174, - 174, 180, 166, 189, 181, 180, 166, 151, 118, 0, - 130, 136, 127, 123, 119, 111, 0, 448, 167, 173, - - 179, 152, 181, 124, 187, 193, 199, 205 + 0, 0, 849, 848, 850, 849, 852, 851, 854, 861, + 54, 56, 861, 0, 861, 861, 861, 861, 861, 861, + 861, 861, 838, 841, 45, 830, 861, 42, 861, 829, + 861, 45, 49, 54, 58, 56, 72, 833, 83, 86, + 63, 67, 90, 53, 105, 107, 106, 120, 51, 101, + 861, 861, 0, 55, 0, 840, 0, 843, 106, 0, + 861, 861, 829, 61, 824, 861, 861, 861, 861, 839, + 827, 88, 124, 130, 132, 125, 826, 129, 133, 136, + 52, 138, 148, 140, 142, 145, 149, 152, 151, 159, + 162, 169, 165, 825, 172, 824, 173, 170, 175, 179, + + 176, 177, 823, 822, 180, 182, 184, 200, 201, 195, + 189, 202, 204, 207, 205, 210, 218, 220, 213, 215, + 223, 230, 238, 217, 0, 240, 244, 861, 0, 829, + 0, 832, 818, 781, 0, 817, 816, 233, 237, 243, + 248, 251, 246, 252, 255, 257, 258, 262, 264, 263, + 265, 267, 266, 269, 273, 270, 815, 274, 275, 287, + 814, 290, 292, 291, 293, 294, 297, 300, 304, 298, + 307, 313, 308, 309, 317, 813, 314, 315, 323, 318, + 324, 328, 331, 332, 333, 812, 336, 811, 338, 810, + 340, 339, 342, 344, 343, 341, 347, 346, 348, 349, + + 359, 773, 0, 356, 369, 370, 360, 808, 371, 807, + 372, 375, 376, 378, 379, 380, 382, 383, 388, 393, + 394, 806, 396, 397, 805, 398, 804, 399, 400, 803, + 403, 404, 408, 413, 405, 802, 415, 801, 800, 799, + 798, 406, 797, 796, 416, 417, 420, 795, 422, 418, + 423, 425, 424, 426, 439, 429, 437, 440, 794, 446, + 450, 453, 454, 455, 457, 458, 459, 460, 793, 757, + 461, 791, 463, 464, 466, 790, 467, 468, 473, 474, + 789, 475, 476, 477, 478, 480, 485, 486, 788, 787, + 786, 489, 785, 491, 784, 498, 493, 494, 783, 499, + + 504, 509, 511, 513, 516, 514, 517, 782, 520, 519, + 781, 521, 523, 527, 525, 528, 526, 529, 780, 779, + 780, 776, 773, 530, 533, 535, 772, 534, 771, 770, + 541, 769, 550, 760, 543, 548, 551, 753, 552, 736, + 554, 730, 556, 557, 723, 558, 566, 563, 693, 692, + 569, 572, 565, 578, 691, 574, 690, 689, 567, 585, + 588, 688, 687, 685, 571, 589, 591, 683, 592, 593, + 681, 680, 595, 596, 679, 597, 678, 599, 604, 602, + 605, 608, 676, 606, 675, 674, 609, 673, 607, 610, + 614, 670, 620, 623, 668, 628, 667, 630, 665, 664, + + 625, 663, 629, 112, 627, 626, 631, 632, 647, 633, + 636, 637, 644, 650, 110, 652, 659, 657, 660, 661, + 662, 57, 861, 710, 719, 728, 731, 734, 738, 747, + 756, 765, 774, 781, 784 } ; -static yyconst flex_int16_t yy_def[409] = +static yyconst flex_int16_t yy_def[436] = { 0, - 398, 1, 399, 399, 400, 400, 401, 401, 398, 398, - 398, 398, 398, 402, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 403, 398, 398, 398, 398, - 398, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 398, 398, 405, 406, 407, 398, 408, 398, 398, 402, - 398, 398, 398, 398, 403, 398, 398, 398, 398, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 405, 406, 406, 398, 407, 398, 408, 398, - 398, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 0, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398 + 423, 1, 424, 424, 425, 425, 426, 426, 423, 423, + 423, 423, 423, 427, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 428, 423, 423, 423, 423, + 423, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 423, 423, 430, 431, 432, 423, 433, 423, 423, 427, + 423, 423, 423, 423, 428, 423, 423, 423, 423, 434, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 430, 431, 431, 423, 432, 423, + 433, 423, 423, 423, 435, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + + 429, 423, 435, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 423, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 423, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, + 429, 429, 0, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423 } ; -static yyconst flex_int16_t yy_nxt[499] = +static yyconst flex_int16_t yy_nxt[917] = { 0, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 38, - 39, 38, 38, 40, 41, 42, 43, 44, 38, 45, - 46, 47, 48, 49, 50, 38, 38, 38, 51, 52, - 59, 59, 59, 59, 63, 71, 64, 67, 68, 73, - 72, 77, 118, 74, 119, 78, 75, 63, 79, 64, - 88, 80, 82, 85, 81, 86, 83, 89, 96, 76, - 90, 93, 84, 91, 99, 87, 92, 101, 97, 94, - 100, 107, 133, 110, 95, 102, 111, 103, 179, 104, - - 108, 109, 105, 115, 121, 112, 180, 125, 134, 113, - 116, 122, 126, 114, 59, 59, 139, 117, 141, 142, - 146, 163, 140, 159, 171, 173, 143, 189, 70, 147, - 172, 177, 183, 164, 207, 208, 148, 190, 160, 161, - 174, 193, 178, 184, 175, 194, 398, 125, 222, 214, - 224, 398, 126, 215, 248, 249, 60, 397, 396, 395, - 225, 394, 393, 223, 392, 391, 250, 53, 53, 53, - 53, 53, 53, 55, 55, 55, 55, 55, 55, 57, - 57, 57, 57, 57, 57, 65, 65, 123, 123, 123, - 390, 123, 123, 124, 124, 124, 124, 124, 124, 127, - - 127, 389, 127, 127, 127, 129, 388, 129, 129, 129, - 129, 387, 386, 385, 384, 383, 382, 381, 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, 247, 246, - 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, - 221, 220, 219, 218, 217, 216, 213, 212, 211, 210, - 209, 206, 205, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 131, 130, 128, 195, 192, 191, 188, 187, - - 186, 185, 182, 181, 176, 170, 169, 168, 167, 166, - 165, 162, 158, 157, 156, 155, 154, 153, 152, 151, - 150, 149, 145, 144, 138, 137, 136, 135, 132, 398, - 131, 130, 128, 120, 106, 98, 69, 66, 62, 61, - 398, 58, 58, 56, 56, 54, 54, 9, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398 - + 10, 11, 12, 13, 10, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 38, 39, 38, 38, 40, 41, 42, 43, 44, 38, + 45, 46, 47, 48, 49, 50, 38, 38, 38, 38, + 38, 38, 38, 51, 52, 59, 59, 59, 59, 63, + 70, 64, 67, 68, 70, 127, 70, 70, 70, 70, + 128, 70, 70, 70, 122, 63, 74, 64, 70, 149, + 75, 72, 70, 76, 78, 83, 73, 70, 79, 84, + 86, 80, 87, 108, 81, 85, 77, 82, 70, 89, + + 100, 70, 88, 70, 101, 70, 90, 59, 59, 91, + 102, 94, 92, 97, 136, 93, 70, 98, 103, 95, + 70, 70, 70, 99, 96, 70, 104, 70, 105, 117, + 106, 123, 109, 107, 112, 70, 118, 113, 124, 70, + 70, 110, 111, 119, 70, 70, 114, 70, 70, 137, + 115, 70, 143, 70, 116, 70, 120, 70, 121, 139, + 70, 140, 142, 70, 70, 138, 70, 70, 141, 155, + 144, 146, 147, 151, 70, 157, 145, 70, 150, 148, + 70, 154, 152, 158, 70, 70, 156, 70, 70, 153, + 70, 70, 70, 159, 70, 70, 160, 70, 164, 70, + + 169, 163, 161, 168, 70, 171, 162, 174, 175, 167, + 70, 173, 170, 165, 166, 70, 70, 70, 172, 70, + 70, 182, 70, 183, 179, 70, 176, 187, 70, 189, + 70, 177, 70, 70, 184, 70, 185, 178, 70, 180, + 190, 188, 192, 181, 186, 70, 195, 193, 70, 197, + 423, 191, 70, 70, 127, 423, 196, 201, 70, 128, + 204, 70, 194, 70, 198, 199, 70, 70, 205, 200, + 70, 207, 70, 70, 206, 208, 209, 70, 70, 70, + 70, 70, 70, 215, 70, 70, 210, 217, 70, 70, + 70, 222, 213, 211, 221, 214, 212, 225, 216, 220, + + 228, 226, 70, 218, 219, 70, 70, 70, 70, 70, + 229, 223, 70, 70, 224, 70, 227, 231, 232, 70, + 233, 235, 70, 70, 70, 230, 237, 238, 70, 70, + 70, 236, 70, 70, 241, 234, 240, 239, 70, 70, + 247, 242, 243, 70, 245, 244, 70, 70, 70, 248, + 246, 70, 249, 70, 70, 70, 70, 70, 70, 70, + 254, 70, 70, 70, 70, 252, 257, 250, 260, 261, + 265, 70, 264, 258, 70, 70, 255, 251, 259, 256, + 262, 253, 263, 268, 70, 70, 70, 70, 267, 266, + 70, 70, 269, 70, 70, 70, 271, 70, 70, 276, + + 274, 279, 280, 70, 275, 272, 273, 278, 70, 70, + 283, 70, 70, 70, 70, 70, 285, 277, 70, 70, + 70, 70, 281, 70, 282, 284, 289, 287, 70, 290, + 70, 70, 70, 70, 296, 70, 286, 70, 70, 70, + 70, 70, 291, 298, 70, 292, 288, 301, 294, 305, + 293, 307, 70, 295, 70, 70, 299, 297, 303, 300, + 310, 70, 306, 302, 304, 70, 308, 311, 70, 70, + 70, 309, 70, 70, 70, 70, 70, 312, 70, 70, + 313, 70, 70, 70, 316, 318, 319, 320, 70, 70, + 70, 70, 70, 70, 326, 70, 314, 315, 328, 317, + + 70, 70, 330, 322, 70, 323, 70, 334, 70, 70, + 327, 324, 331, 70, 70, 325, 329, 332, 333, 70, + 337, 335, 336, 340, 70, 339, 70, 342, 70, 70, + 343, 70, 70, 338, 70, 70, 70, 341, 70, 347, + 70, 70, 70, 70, 70, 70, 353, 345, 70, 70, + 70, 344, 355, 357, 348, 346, 70, 352, 70, 349, + 350, 351, 354, 70, 356, 70, 70, 70, 365, 70, + 358, 70, 70, 70, 360, 361, 362, 364, 70, 359, + 70, 70, 70, 363, 70, 366, 70, 70, 367, 70, + 369, 373, 368, 70, 374, 376, 375, 371, 372, 370, + + 70, 379, 378, 70, 70, 377, 70, 70, 70, 380, + 70, 70, 70, 383, 70, 382, 381, 70, 386, 70, + 70, 70, 70, 70, 70, 70, 391, 385, 388, 70, + 392, 384, 389, 387, 395, 70, 397, 390, 70, 393, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 398, + 402, 70, 70, 394, 400, 396, 403, 399, 404, 70, + 406, 405, 70, 413, 412, 70, 409, 70, 408, 401, + 407, 411, 70, 414, 70, 70, 70, 70, 70, 70, + 70, 410, 70, 70, 415, 70, 418, 417, 70, 70, + 70, 70, 419, 70, 70, 70, 70, 420, 70, 416, + + 70, 421, 70, 70, 70, 70, 70, 70, 70, 422, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 60, 70, 60, + 65, 65, 65, 71, 71, 70, 71, 125, 125, 125, + 125, 70, 125, 125, 125, 125, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 129, 129, 129, 70, 129, + 129, 129, 129, 129, 131, 70, 131, 131, 131, 131, + 131, 131, 131, 135, 70, 70, 70, 70, 70, 135, + 203, 70, 203, 135, 70, 70, 70, 70, 70, 70, + + 70, 70, 70, 70, 70, 70, 70, 321, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 270, 70, 70, 70, 70, 70, + 70, 70, 70, 202, 133, 132, 130, 70, 70, 70, + 70, 70, 70, 134, 423, 133, 132, 130, 70, 69, + 66, 62, 61, 423, 58, 58, 56, 56, 54, 54, + 9, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423 } ; -static yyconst flex_int16_t yy_chk[499] = +static yyconst flex_int16_t yy_chk[917] = { 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 11, 12, 12, 25, 32, 25, 28, 28, 33, - 32, 34, 48, 33, 48, 34, 33, 64, 34, 64, - 37, 34, 35, 36, 34, 36, 35, 37, 40, 33, - 37, 39, 35, 37, 42, 36, 37, 43, 40, 39, - 42, 45, 72, 46, 39, 43, 46, 43, 110, 43, - - 45, 45, 43, 47, 50, 46, 110, 54, 72, 46, - 47, 50, 54, 46, 59, 59, 78, 47, 79, 79, - 82, 97, 78, 94, 106, 107, 79, 118, 404, 82, - 106, 109, 113, 97, 145, 145, 82, 118, 94, 94, - 107, 121, 109, 113, 107, 121, 124, 125, 160, 151, - 161, 124, 125, 151, 188, 188, 402, 396, 395, 394, - 161, 393, 392, 160, 391, 389, 188, 399, 399, 399, - 399, 399, 399, 400, 400, 400, 400, 400, 400, 401, - 401, 401, 401, 401, 401, 403, 403, 405, 405, 405, - 388, 405, 405, 406, 406, 406, 406, 406, 406, 407, - - 407, 387, 407, 407, 407, 408, 386, 408, 408, 408, - 408, 385, 384, 383, 382, 381, 380, 378, 377, 374, - 372, 370, 368, 367, 366, 364, 361, 359, 358, 357, - 356, 354, 352, 351, 348, 347, 345, 344, 343, 340, - 339, 336, 334, 333, 332, 331, 328, 327, 326, 324, - 323, 321, 319, 317, 316, 315, 313, 311, 307, 306, - 302, 301, 300, 299, 298, 297, 296, 294, 293, 291, - 290, 289, 288, 287, 286, 285, 284, 282, 281, 280, - 278, 276, 272, 271, 270, 269, 268, 267, 266, 264, - 263, 262, 260, 258, 256, 255, 254, 253, 252, 251, - - 250, 249, 248, 246, 245, 244, 243, 242, 241, 240, - 239, 238, 237, 235, 234, 233, 230, 226, 224, 223, - 222, 221, 220, 218, 217, 215, 213, 212, 210, 209, - 208, 207, 206, 205, 204, 203, 202, 201, 198, 197, - 196, 195, 194, 193, 192, 191, 190, 189, 187, 186, - 185, 183, 181, 179, 178, 177, 176, 175, 174, 173, - 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, - 159, 158, 157, 155, 154, 153, 150, 149, 148, 147, - 146, 144, 143, 142, 141, 140, 139, 138, 137, 136, - 135, 134, 131, 130, 128, 122, 120, 119, 117, 116, - - 115, 114, 112, 111, 108, 105, 104, 103, 100, 99, - 98, 96, 92, 91, 90, 89, 88, 87, 86, 85, - 84, 83, 81, 80, 77, 75, 74, 73, 71, 65, - 63, 58, 56, 49, 44, 41, 30, 26, 24, 23, - 9, 8, 7, 6, 5, 4, 3, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398 - + 1, 1, 1, 1, 1, 11, 11, 12, 12, 25, + 32, 25, 28, 28, 33, 54, 49, 81, 44, 34, + 54, 36, 422, 35, 49, 64, 33, 64, 41, 81, + 33, 32, 42, 33, 34, 35, 32, 37, 34, 35, + 36, 34, 36, 44, 34, 35, 33, 34, 39, 37, + + 41, 40, 36, 72, 42, 43, 37, 59, 59, 37, + 42, 39, 37, 40, 72, 37, 50, 40, 43, 39, + 45, 47, 46, 40, 39, 415, 43, 404, 43, 47, + 43, 50, 45, 43, 46, 48, 47, 46, 50, 73, + 76, 45, 45, 47, 78, 74, 46, 75, 79, 73, + 46, 80, 78, 82, 46, 84, 48, 85, 48, 74, + 86, 75, 76, 83, 87, 73, 89, 88, 75, 85, + 79, 80, 80, 83, 90, 87, 79, 91, 82, 80, + 93, 84, 83, 88, 92, 98, 86, 95, 97, 83, + 99, 101, 102, 89, 100, 105, 90, 106, 95, 107, + + 99, 93, 91, 98, 111, 100, 92, 105, 106, 97, + 110, 102, 99, 95, 95, 108, 109, 112, 101, 113, + 115, 110, 114, 111, 109, 116, 107, 113, 119, 115, + 120, 108, 124, 117, 111, 118, 112, 108, 121, 109, + 115, 114, 117, 109, 112, 122, 120, 118, 138, 121, + 126, 116, 139, 123, 127, 126, 120, 124, 140, 127, + 138, 143, 119, 141, 122, 123, 142, 144, 139, 123, + 145, 141, 146, 147, 140, 142, 142, 148, 150, 149, + 151, 153, 152, 147, 154, 156, 143, 149, 155, 158, + 159, 153, 146, 144, 152, 146, 145, 156, 148, 151, + + 159, 156, 160, 150, 150, 162, 164, 163, 165, 166, + 160, 154, 167, 170, 155, 168, 158, 163, 164, 169, + 165, 166, 171, 173, 174, 162, 167, 168, 172, 177, + 178, 166, 175, 180, 171, 165, 170, 169, 179, 181, + 178, 172, 173, 182, 175, 174, 183, 184, 185, 179, + 177, 187, 180, 189, 192, 191, 196, 193, 195, 194, + 185, 198, 197, 199, 200, 183, 191, 181, 194, 194, + 197, 204, 196, 192, 201, 207, 187, 182, 193, 189, + 194, 184, 195, 200, 205, 206, 209, 211, 199, 198, + 212, 213, 201, 214, 215, 216, 204, 217, 218, 211, + + 207, 214, 215, 219, 209, 205, 206, 213, 220, 221, + 218, 223, 224, 226, 228, 229, 220, 212, 231, 232, + 235, 242, 216, 233, 217, 219, 226, 223, 234, 228, + 237, 245, 246, 250, 235, 247, 221, 249, 251, 253, + 252, 254, 229, 242, 256, 231, 224, 247, 233, 252, + 232, 254, 257, 234, 255, 258, 245, 237, 250, 246, + 257, 260, 253, 249, 251, 261, 255, 258, 262, 263, + 264, 256, 265, 266, 267, 268, 271, 260, 273, 274, + 261, 275, 277, 278, 264, 266, 267, 268, 279, 280, + 282, 283, 284, 285, 277, 286, 262, 263, 279, 265, + + 287, 288, 282, 271, 292, 273, 294, 286, 297, 298, + 278, 274, 283, 296, 300, 275, 280, 284, 285, 301, + 292, 287, 288, 297, 302, 296, 303, 300, 304, 306, + 301, 305, 307, 294, 310, 309, 312, 298, 313, 305, + 315, 317, 314, 316, 318, 324, 313, 303, 325, 328, + 326, 302, 315, 317, 306, 304, 331, 312, 335, 307, + 309, 310, 314, 336, 316, 333, 337, 339, 335, 341, + 318, 343, 344, 346, 325, 326, 328, 333, 348, 324, + 353, 347, 359, 331, 351, 336, 365, 352, 337, 356, + 341, 347, 339, 354, 348, 352, 351, 344, 346, 343, + + 360, 356, 354, 361, 366, 353, 367, 369, 370, 359, + 373, 374, 376, 365, 378, 361, 360, 380, 369, 379, + 381, 384, 389, 382, 387, 390, 378, 367, 373, 391, + 379, 366, 374, 370, 382, 393, 387, 376, 394, 380, + 401, 406, 405, 396, 403, 398, 407, 408, 410, 389, + 394, 411, 412, 381, 391, 384, 396, 390, 398, 413, + 403, 401, 409, 411, 410, 414, 407, 416, 406, 393, + 405, 409, 418, 412, 417, 419, 420, 421, 402, 400, + 399, 408, 397, 395, 413, 392, 417, 416, 388, 386, + 385, 383, 418, 377, 375, 372, 371, 419, 368, 414, + + 364, 420, 363, 362, 358, 357, 355, 350, 349, 421, + 424, 424, 424, 424, 424, 424, 424, 424, 424, 425, + 425, 425, 425, 425, 425, 425, 425, 425, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 427, 345, 427, + 428, 428, 428, 429, 429, 342, 429, 430, 430, 430, + 430, 340, 430, 430, 430, 430, 431, 431, 431, 431, + 431, 431, 431, 431, 431, 432, 432, 432, 338, 432, + 432, 432, 432, 432, 433, 334, 433, 433, 433, 433, + 433, 433, 433, 434, 332, 330, 329, 327, 323, 434, + 435, 322, 435, 321, 320, 319, 311, 308, 299, 295, + + 293, 291, 290, 289, 281, 276, 272, 270, 269, 259, + 248, 244, 243, 241, 240, 239, 238, 236, 230, 227, + 225, 222, 210, 208, 202, 190, 188, 186, 176, 161, + 157, 137, 136, 134, 133, 132, 130, 104, 103, 96, + 94, 77, 71, 70, 65, 63, 58, 56, 38, 30, + 26, 24, 23, 9, 8, 7, 6, 5, 4, 3, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -static int yy_flex_debug; -static int yy_flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -701,15 +793,27 @@ static int yy_flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -static char *yytext; +char *yytext; #line 1 "pars0lex.l" -/**************************************************//** -SQL parser lexical analyzer: input file for the GNU Flex lexer generator +/***************************************************************************** -(c) 1997 Innobase Oy +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. -Created 12/14/1997 Heikki Tuuri -Published under the GPL version 2 +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + +*****************************************************************************/ +/****************************************************** +SQL parser lexical analyzer: input file for the GNU Flex lexer generator The InnoDB parser is frozen because MySQL takes care of SQL parsing. Therefore we normally keep the InnoDB parser C files as they are, and do @@ -723,10 +827,12 @@ How to make the InnoDB parser and lexer C files: These instructions seem to work at least with bison-1.875d and flex-2.5.31 on Linux. + +Created 12/14/1997 Heikki Tuuri *******************************************************/ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 -#line 38 "pars0lex.l" +#line 53 "pars0lex.l" #define YYSTYPE que_node_t* #include "univ.i" @@ -741,7 +847,8 @@ Linux. #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) +#define YY_INPUT(buf, result, max_size) \ + (result = pars_get_lex_chars(buf, max_size)) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -756,7 +863,7 @@ string_append( ulint len) /*!< in: length of the string */ { if (stringbuf == NULL) { - stringbuf = malloc(1); + stringbuf = static_cast<char*>(malloc(1)); stringbuf_len_alloc = 1; } @@ -764,7 +871,9 @@ string_append( while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = realloc(stringbuf, stringbuf_len_alloc); + + stringbuf = static_cast<char*>( + realloc(stringbuf, stringbuf_len_alloc)); } memcpy(stringbuf + stringbuf_len, str, len); @@ -774,7 +883,7 @@ string_append( -#line 759 "lexyy.c" +#line 887 "lexyy.cc" #define INITIAL 0 #define comment 1 @@ -793,6 +902,37 @@ string_append( #define YY_EXTRA_TYPE void * #endif +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +__attribute__((unused)) static int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -833,7 +973,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -844,7 +984,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -898,9 +1038,9 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -UNIV_INTERN int yylex (void); +extern int yylex (void); -#define YY_DECL UNIV_INTERN int yylex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -925,15 +1065,15 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - -#line 92 "pars0lex.l" + +#line 112 "pars0lex.l" -#line 914 "lexyy.c" +#line 1073 "lexyy.cc" - if ( (yy_init) ) + if ( !(yy_init) ) { - (yy_init) = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; @@ -982,13 +1122,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 >= 399 ) + if ( yy_current_state >= 424 ) 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 != 398 ); + while ( yy_current_state != 423 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1010,7 +1150,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 94 "pars0lex.l" +#line 114 "pars0lex.l" { yylval = sym_tab_add_int_lit(pars_sym_tab_global, atoi(yytext)); @@ -1019,7 +1159,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 100 "pars0lex.l" +#line 120 "pars0lex.l" { ut_error; /* not implemented */ @@ -1028,7 +1168,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 106 "pars0lex.l" +#line 126 "pars0lex.l" { ulint type; @@ -1040,7 +1180,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 115 "pars0lex.l" +#line 135 "pars0lex.l" { yylval = sym_tab_add_bound_id(pars_sym_tab_global, yytext + 1); @@ -1050,7 +1190,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 122 "pars0lex.l" +#line 142 "pars0lex.l" { /* Quoted character string literals are handled in an explicit start state 'quoted'. This state is entered and the buffer for @@ -1064,7 +1204,7 @@ In the state 'quoted', only two actions are possible (defined below). */ case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 131 "pars0lex.l" +#line 151 "pars0lex.l" { /* Got a sequence of characters other than "'": append to string buffer */ @@ -1073,7 +1213,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 136 "pars0lex.l" +#line 156 "pars0lex.l" { /* Got a sequence of "'" characters: append half of them to string buffer, @@ -1100,7 +1240,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 160 "pars0lex.l" +#line 180 "pars0lex.l" { /* Quoted identifiers are handled in an explicit start state 'id'. This state is entered and the buffer for the scanned string is emptied @@ -1114,7 +1254,7 @@ In the state 'id', only two actions are possible (defined below). */ case 9: /* rule 9 can match eol */ YY_RULE_SETUP -#line 169 "pars0lex.l" +#line 189 "pars0lex.l" { /* Got a sequence of characters other than '"': append to string buffer */ @@ -1123,7 +1263,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 174 "pars0lex.l" +#line 194 "pars0lex.l" { /* Got a sequence of '"' characters: append half of them to string buffer, @@ -1151,7 +1291,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 199 "pars0lex.l" +#line 219 "pars0lex.l" { yylval = sym_tab_add_null_lit(pars_sym_tab_global); @@ -1160,7 +1300,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 205 "pars0lex.l" +#line 225 "pars0lex.l" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, @@ -1170,645 +1310,643 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 212 "pars0lex.l" +#line 232 "pars0lex.l" { return(PARS_AND_TOKEN); } YY_BREAK case 14: YY_RULE_SETUP -#line 216 "pars0lex.l" +#line 236 "pars0lex.l" { return(PARS_OR_TOKEN); } YY_BREAK case 15: YY_RULE_SETUP -#line 220 "pars0lex.l" +#line 240 "pars0lex.l" { return(PARS_NOT_TOKEN); } YY_BREAK case 16: YY_RULE_SETUP -#line 224 "pars0lex.l" +#line 244 "pars0lex.l" { return(PARS_PROCEDURE_TOKEN); } YY_BREAK case 17: YY_RULE_SETUP -#line 228 "pars0lex.l" +#line 248 "pars0lex.l" { return(PARS_IN_TOKEN); } YY_BREAK case 18: YY_RULE_SETUP -#line 232 "pars0lex.l" +#line 252 "pars0lex.l" { return(PARS_OUT_TOKEN); } YY_BREAK case 19: YY_RULE_SETUP -#line 236 "pars0lex.l" +#line 256 "pars0lex.l" { - return(PARS_BINARY_TOKEN); + return(PARS_BINARY_TOKEN); } YY_BREAK case 20: YY_RULE_SETUP -#line 240 "pars0lex.l" +#line 260 "pars0lex.l" { - return(PARS_BLOB_TOKEN); + return(PARS_BLOB_TOKEN); } YY_BREAK case 21: YY_RULE_SETUP -#line 244 "pars0lex.l" +#line 264 "pars0lex.l" { - return(PARS_INT_TOKEN); + return(PARS_INT_TOKEN); } YY_BREAK case 22: YY_RULE_SETUP -#line 248 "pars0lex.l" +#line 268 "pars0lex.l" { - return(PARS_INT_TOKEN); + return(PARS_INT_TOKEN); } YY_BREAK case 23: YY_RULE_SETUP -#line 252 "pars0lex.l" +#line 272 "pars0lex.l" { - return(PARS_FLOAT_TOKEN); + return(PARS_FLOAT_TOKEN); } YY_BREAK case 24: YY_RULE_SETUP -#line 256 "pars0lex.l" +#line 276 "pars0lex.l" { - return(PARS_CHAR_TOKEN); + return(PARS_CHAR_TOKEN); } YY_BREAK case 25: YY_RULE_SETUP -#line 260 "pars0lex.l" +#line 280 "pars0lex.l" { return(PARS_IS_TOKEN); } YY_BREAK case 26: YY_RULE_SETUP -#line 264 "pars0lex.l" +#line 284 "pars0lex.l" { return(PARS_BEGIN_TOKEN); } YY_BREAK case 27: YY_RULE_SETUP -#line 268 "pars0lex.l" +#line 288 "pars0lex.l" { return(PARS_END_TOKEN); } YY_BREAK case 28: YY_RULE_SETUP -#line 272 "pars0lex.l" +#line 292 "pars0lex.l" { return(PARS_IF_TOKEN); } YY_BREAK case 29: YY_RULE_SETUP -#line 276 "pars0lex.l" +#line 296 "pars0lex.l" { return(PARS_THEN_TOKEN); } YY_BREAK case 30: YY_RULE_SETUP -#line 280 "pars0lex.l" +#line 300 "pars0lex.l" { return(PARS_ELSE_TOKEN); } YY_BREAK case 31: YY_RULE_SETUP -#line 284 "pars0lex.l" +#line 304 "pars0lex.l" { return(PARS_ELSIF_TOKEN); } YY_BREAK case 32: YY_RULE_SETUP -#line 288 "pars0lex.l" +#line 308 "pars0lex.l" { return(PARS_LOOP_TOKEN); } YY_BREAK case 33: YY_RULE_SETUP -#line 292 "pars0lex.l" +#line 312 "pars0lex.l" { return(PARS_WHILE_TOKEN); } YY_BREAK case 34: YY_RULE_SETUP -#line 296 "pars0lex.l" +#line 316 "pars0lex.l" { return(PARS_RETURN_TOKEN); } YY_BREAK case 35: YY_RULE_SETUP -#line 300 "pars0lex.l" +#line 320 "pars0lex.l" { return(PARS_SELECT_TOKEN); } YY_BREAK case 36: YY_RULE_SETUP -#line 304 "pars0lex.l" +#line 324 "pars0lex.l" { return(PARS_SUM_TOKEN); } YY_BREAK case 37: YY_RULE_SETUP -#line 308 "pars0lex.l" +#line 328 "pars0lex.l" { return(PARS_COUNT_TOKEN); } YY_BREAK case 38: YY_RULE_SETUP -#line 312 "pars0lex.l" +#line 332 "pars0lex.l" { return(PARS_DISTINCT_TOKEN); } YY_BREAK case 39: YY_RULE_SETUP -#line 316 "pars0lex.l" +#line 336 "pars0lex.l" { return(PARS_FROM_TOKEN); } YY_BREAK case 40: YY_RULE_SETUP -#line 320 "pars0lex.l" +#line 340 "pars0lex.l" { return(PARS_WHERE_TOKEN); } YY_BREAK case 41: YY_RULE_SETUP -#line 324 "pars0lex.l" +#line 344 "pars0lex.l" { return(PARS_FOR_TOKEN); } YY_BREAK case 42: YY_RULE_SETUP -#line 328 "pars0lex.l" +#line 348 "pars0lex.l" { return(PARS_READ_TOKEN); } YY_BREAK case 43: YY_RULE_SETUP -#line 332 "pars0lex.l" +#line 352 "pars0lex.l" { return(PARS_ORDER_TOKEN); } YY_BREAK case 44: YY_RULE_SETUP -#line 336 "pars0lex.l" +#line 356 "pars0lex.l" { return(PARS_BY_TOKEN); } YY_BREAK case 45: YY_RULE_SETUP -#line 340 "pars0lex.l" +#line 360 "pars0lex.l" { return(PARS_ASC_TOKEN); } YY_BREAK case 46: YY_RULE_SETUP -#line 344 "pars0lex.l" +#line 364 "pars0lex.l" { return(PARS_DESC_TOKEN); } YY_BREAK case 47: YY_RULE_SETUP -#line 348 "pars0lex.l" +#line 368 "pars0lex.l" { return(PARS_INSERT_TOKEN); } YY_BREAK case 48: YY_RULE_SETUP -#line 352 "pars0lex.l" +#line 372 "pars0lex.l" { return(PARS_INTO_TOKEN); } YY_BREAK case 49: YY_RULE_SETUP -#line 356 "pars0lex.l" +#line 376 "pars0lex.l" { return(PARS_VALUES_TOKEN); } YY_BREAK case 50: YY_RULE_SETUP -#line 360 "pars0lex.l" +#line 380 "pars0lex.l" { return(PARS_UPDATE_TOKEN); } YY_BREAK case 51: YY_RULE_SETUP -#line 364 "pars0lex.l" +#line 384 "pars0lex.l" { return(PARS_SET_TOKEN); } YY_BREAK case 52: YY_RULE_SETUP -#line 368 "pars0lex.l" +#line 388 "pars0lex.l" { return(PARS_DELETE_TOKEN); } YY_BREAK case 53: YY_RULE_SETUP -#line 372 "pars0lex.l" +#line 392 "pars0lex.l" { return(PARS_CURRENT_TOKEN); } YY_BREAK case 54: YY_RULE_SETUP -#line 376 "pars0lex.l" +#line 396 "pars0lex.l" { return(PARS_OF_TOKEN); } YY_BREAK case 55: YY_RULE_SETUP -#line 380 "pars0lex.l" +#line 400 "pars0lex.l" { return(PARS_CREATE_TOKEN); } YY_BREAK case 56: YY_RULE_SETUP -#line 384 "pars0lex.l" +#line 404 "pars0lex.l" { return(PARS_TABLE_TOKEN); } YY_BREAK case 57: YY_RULE_SETUP -#line 388 "pars0lex.l" +#line 408 "pars0lex.l" { - return(PARS_INDEX_TOKEN); + return(PARS_COMPACT_TOKEN); } YY_BREAK case 58: YY_RULE_SETUP -#line 392 "pars0lex.l" +#line 412 "pars0lex.l" { - return(PARS_UNIQUE_TOKEN); + return(PARS_BLOCK_SIZE_TOKEN); } YY_BREAK case 59: YY_RULE_SETUP -#line 396 "pars0lex.l" +#line 416 "pars0lex.l" { - return(PARS_CLUSTERED_TOKEN); + return(PARS_INDEX_TOKEN); } YY_BREAK case 60: YY_RULE_SETUP -#line 400 "pars0lex.l" +#line 420 "pars0lex.l" { - return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN); + return(PARS_UNIQUE_TOKEN); } YY_BREAK case 61: YY_RULE_SETUP -#line 404 "pars0lex.l" +#line 424 "pars0lex.l" { - return(PARS_ON_TOKEN); + return(PARS_CLUSTERED_TOKEN); } YY_BREAK case 62: YY_RULE_SETUP -#line 408 "pars0lex.l" +#line 428 "pars0lex.l" { - return(PARS_DECLARE_TOKEN); + return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN); } YY_BREAK case 63: YY_RULE_SETUP -#line 412 "pars0lex.l" +#line 432 "pars0lex.l" { - return(PARS_CURSOR_TOKEN); + return(PARS_ON_TOKEN); } YY_BREAK case 64: YY_RULE_SETUP -#line 416 "pars0lex.l" +#line 436 "pars0lex.l" { - return(PARS_OPEN_TOKEN); + return(PARS_DECLARE_TOKEN); } YY_BREAK case 65: YY_RULE_SETUP -#line 420 "pars0lex.l" +#line 440 "pars0lex.l" { - return(PARS_FETCH_TOKEN); + return(PARS_CURSOR_TOKEN); } YY_BREAK case 66: YY_RULE_SETUP -#line 424 "pars0lex.l" +#line 444 "pars0lex.l" { - return(PARS_CLOSE_TOKEN); + return(PARS_OPEN_TOKEN); } YY_BREAK case 67: YY_RULE_SETUP -#line 428 "pars0lex.l" +#line 448 "pars0lex.l" { - return(PARS_NOTFOUND_TOKEN); + return(PARS_FETCH_TOKEN); } YY_BREAK case 68: YY_RULE_SETUP -#line 432 "pars0lex.l" +#line 452 "pars0lex.l" { - return(PARS_TO_CHAR_TOKEN); + return(PARS_CLOSE_TOKEN); } YY_BREAK case 69: YY_RULE_SETUP -#line 436 "pars0lex.l" +#line 456 "pars0lex.l" { - return(PARS_TO_NUMBER_TOKEN); + return(PARS_NOTFOUND_TOKEN); } YY_BREAK case 70: YY_RULE_SETUP -#line 440 "pars0lex.l" +#line 460 "pars0lex.l" { - return(PARS_TO_BINARY_TOKEN); + return(PARS_TO_CHAR_TOKEN); } YY_BREAK case 71: YY_RULE_SETUP -#line 444 "pars0lex.l" +#line 464 "pars0lex.l" { - return(PARS_BINARY_TO_NUMBER_TOKEN); + return(PARS_TO_NUMBER_TOKEN); } YY_BREAK case 72: YY_RULE_SETUP -#line 448 "pars0lex.l" +#line 468 "pars0lex.l" { - return(PARS_SUBSTR_TOKEN); + return(PARS_TO_BINARY_TOKEN); } YY_BREAK case 73: YY_RULE_SETUP -#line 452 "pars0lex.l" +#line 472 "pars0lex.l" { - return(PARS_REPLSTR_TOKEN); + return(PARS_BINARY_TO_NUMBER_TOKEN); } YY_BREAK case 74: YY_RULE_SETUP -#line 456 "pars0lex.l" +#line 476 "pars0lex.l" { - return(PARS_CONCAT_TOKEN); + return(PARS_SUBSTR_TOKEN); } YY_BREAK case 75: YY_RULE_SETUP -#line 460 "pars0lex.l" +#line 480 "pars0lex.l" { - return(PARS_INSTR_TOKEN); + return(PARS_REPLSTR_TOKEN); } YY_BREAK case 76: YY_RULE_SETUP -#line 464 "pars0lex.l" +#line 484 "pars0lex.l" { - return(PARS_LENGTH_TOKEN); + return(PARS_CONCAT_TOKEN); } YY_BREAK case 77: YY_RULE_SETUP -#line 468 "pars0lex.l" +#line 488 "pars0lex.l" { - return(PARS_SYSDATE_TOKEN); + return(PARS_INSTR_TOKEN); } YY_BREAK case 78: YY_RULE_SETUP -#line 472 "pars0lex.l" +#line 492 "pars0lex.l" { - return(PARS_PRINTF_TOKEN); + return(PARS_LENGTH_TOKEN); } YY_BREAK case 79: YY_RULE_SETUP -#line 476 "pars0lex.l" +#line 496 "pars0lex.l" { - return(PARS_ASSERT_TOKEN); + return(PARS_SYSDATE_TOKEN); } YY_BREAK case 80: YY_RULE_SETUP -#line 480 "pars0lex.l" +#line 500 "pars0lex.l" { - return(PARS_RND_TOKEN); + return(PARS_PRINTF_TOKEN); } YY_BREAK case 81: YY_RULE_SETUP -#line 484 "pars0lex.l" +#line 504 "pars0lex.l" { - return(PARS_RND_STR_TOKEN); + return(PARS_ASSERT_TOKEN); } YY_BREAK case 82: YY_RULE_SETUP -#line 488 "pars0lex.l" +#line 508 "pars0lex.l" { - return(PARS_ROW_PRINTF_TOKEN); + return(PARS_RND_TOKEN); } YY_BREAK case 83: YY_RULE_SETUP -#line 492 "pars0lex.l" +#line 512 "pars0lex.l" { - return(PARS_COMMIT_TOKEN); + return(PARS_RND_STR_TOKEN); } YY_BREAK case 84: YY_RULE_SETUP -#line 496 "pars0lex.l" +#line 516 "pars0lex.l" { - return(PARS_ROLLBACK_TOKEN); + return(PARS_ROW_PRINTF_TOKEN); } YY_BREAK case 85: YY_RULE_SETUP -#line 500 "pars0lex.l" +#line 520 "pars0lex.l" { - return(PARS_WORK_TOKEN); + return(PARS_COMMIT_TOKEN); } YY_BREAK case 86: YY_RULE_SETUP -#line 504 "pars0lex.l" +#line 524 "pars0lex.l" { - return(PARS_UNSIGNED_TOKEN); + return(PARS_ROLLBACK_TOKEN); } YY_BREAK case 87: YY_RULE_SETUP -#line 508 "pars0lex.l" +#line 528 "pars0lex.l" { - return(PARS_EXIT_TOKEN); + return(PARS_WORK_TOKEN); } YY_BREAK case 88: YY_RULE_SETUP -#line 512 "pars0lex.l" +#line 532 "pars0lex.l" { - return(PARS_FUNCTION_TOKEN); + return(PARS_UNSIGNED_TOKEN); } YY_BREAK case 89: YY_RULE_SETUP -#line 516 "pars0lex.l" +#line 536 "pars0lex.l" { - return(PARS_LOCK_TOKEN); + return(PARS_EXIT_TOKEN); } YY_BREAK case 90: YY_RULE_SETUP -#line 520 "pars0lex.l" +#line 540 "pars0lex.l" { - return(PARS_SHARE_TOKEN); + return(PARS_FUNCTION_TOKEN); } YY_BREAK case 91: YY_RULE_SETUP -#line 524 "pars0lex.l" +#line 544 "pars0lex.l" { - return(PARS_MODE_TOKEN); + return(PARS_LOCK_TOKEN); } YY_BREAK case 92: YY_RULE_SETUP -#line 528 "pars0lex.l" +#line 548 "pars0lex.l" { - yylval = sym_tab_add_id(pars_sym_tab_global, - (byte*)yytext, - ut_strlen(yytext)); - return(PARS_ID_TOKEN); + return(PARS_SHARE_TOKEN); } YY_BREAK case 93: YY_RULE_SETUP -#line 535 "pars0lex.l" +#line 552 "pars0lex.l" { - return(PARS_DDOT_TOKEN); + return(PARS_MODE_TOKEN); } YY_BREAK case 94: YY_RULE_SETUP -#line 539 "pars0lex.l" +#line 556 "pars0lex.l" { - return(PARS_ASSIGN_TOKEN); + return(PARS_LIKE_TOKEN); } YY_BREAK case 95: YY_RULE_SETUP -#line 543 "pars0lex.l" +#line 560 "pars0lex.l" { - return(PARS_LE_TOKEN); + return(PARS_BIGINT_TOKEN); } YY_BREAK case 96: YY_RULE_SETUP -#line 547 "pars0lex.l" +#line 564 "pars0lex.l" { - return(PARS_GE_TOKEN); + yylval = sym_tab_add_id(pars_sym_tab_global, + (byte*) yytext, + ut_strlen(yytext)); + return(PARS_ID_TOKEN); } YY_BREAK case 97: YY_RULE_SETUP -#line 551 "pars0lex.l" +#line 571 "pars0lex.l" { - return(PARS_NE_TOKEN); + yylval = sym_tab_add_id(pars_sym_tab_global, + (byte*) yytext, + ut_strlen(yytext)); + return(PARS_TABLE_NAME_TOKEN); } YY_BREAK case 98: YY_RULE_SETUP -#line 555 "pars0lex.l" +#line 578 "pars0lex.l" { - - return((int)(*yytext)); + return(PARS_DDOT_TOKEN); } YY_BREAK case 99: YY_RULE_SETUP -#line 560 "pars0lex.l" +#line 582 "pars0lex.l" { - - return((int)(*yytext)); + return(PARS_ASSIGN_TOKEN); } YY_BREAK case 100: YY_RULE_SETUP -#line 565 "pars0lex.l" +#line 586 "pars0lex.l" { - - return((int)(*yytext)); + return(PARS_LE_TOKEN); } YY_BREAK case 101: YY_RULE_SETUP -#line 570 "pars0lex.l" +#line 590 "pars0lex.l" { - - return((int)(*yytext)); + return(PARS_GE_TOKEN); } YY_BREAK case 102: YY_RULE_SETUP -#line 575 "pars0lex.l" +#line 594 "pars0lex.l" { - - return((int)(*yytext)); + return(PARS_NE_TOKEN); } YY_BREAK case 103: YY_RULE_SETUP -#line 580 "pars0lex.l" +#line 598 "pars0lex.l" { return((int)(*yytext)); @@ -1816,7 +1954,7 @@ YY_RULE_SETUP YY_BREAK case 104: YY_RULE_SETUP -#line 585 "pars0lex.l" +#line 603 "pars0lex.l" { return((int)(*yytext)); @@ -1824,7 +1962,7 @@ YY_RULE_SETUP YY_BREAK case 105: YY_RULE_SETUP -#line 590 "pars0lex.l" +#line 608 "pars0lex.l" { return((int)(*yytext)); @@ -1832,7 +1970,7 @@ YY_RULE_SETUP YY_BREAK case 106: YY_RULE_SETUP -#line 595 "pars0lex.l" +#line 613 "pars0lex.l" { return((int)(*yytext)); @@ -1840,7 +1978,7 @@ YY_RULE_SETUP YY_BREAK case 107: YY_RULE_SETUP -#line 600 "pars0lex.l" +#line 618 "pars0lex.l" { return((int)(*yytext)); @@ -1848,7 +1986,7 @@ YY_RULE_SETUP YY_BREAK case 108: YY_RULE_SETUP -#line 605 "pars0lex.l" +#line 623 "pars0lex.l" { return((int)(*yytext)); @@ -1856,7 +1994,7 @@ YY_RULE_SETUP YY_BREAK case 109: YY_RULE_SETUP -#line 610 "pars0lex.l" +#line 628 "pars0lex.l" { return((int)(*yytext)); @@ -1864,7 +2002,7 @@ YY_RULE_SETUP YY_BREAK case 110: YY_RULE_SETUP -#line 615 "pars0lex.l" +#line 633 "pars0lex.l" { return((int)(*yytext)); @@ -1872,7 +2010,7 @@ YY_RULE_SETUP YY_BREAK case 111: YY_RULE_SETUP -#line 620 "pars0lex.l" +#line 638 "pars0lex.l" { return((int)(*yytext)); @@ -1880,7 +2018,7 @@ YY_RULE_SETUP YY_BREAK case 112: YY_RULE_SETUP -#line 625 "pars0lex.l" +#line 643 "pars0lex.l" { return((int)(*yytext)); @@ -1888,35 +2026,75 @@ YY_RULE_SETUP YY_BREAK case 113: YY_RULE_SETUP -#line 630 "pars0lex.l" -BEGIN(comment); /* eat up comment */ +#line 648 "pars0lex.l" +{ + + return((int)(*yytext)); +} YY_BREAK case 114: -/* rule 114 can match eol */ YY_RULE_SETUP -#line 632 "pars0lex.l" +#line 653 "pars0lex.l" +{ + return((int)(*yytext)); +} YY_BREAK case 115: -/* rule 115 can match eol */ YY_RULE_SETUP -#line 633 "pars0lex.l" +#line 658 "pars0lex.l" +{ + return((int)(*yytext)); +} YY_BREAK case 116: YY_RULE_SETUP -#line 634 "pars0lex.l" -BEGIN(INITIAL); +#line 663 "pars0lex.l" +{ + + return((int)(*yytext)); +} YY_BREAK case 117: -/* rule 117 can match eol */ YY_RULE_SETUP -#line 636 "pars0lex.l" -/* eat up whitespace */ +#line 668 "pars0lex.l" +{ + + return((int)(*yytext)); +} YY_BREAK case 118: YY_RULE_SETUP -#line 639 "pars0lex.l" +#line 673 "pars0lex.l" +BEGIN(comment); /* eat up comment */ + YY_BREAK +case 119: +/* rule 119 can match eol */ +YY_RULE_SETUP +#line 675 "pars0lex.l" + + YY_BREAK +case 120: +/* rule 120 can match eol */ +YY_RULE_SETUP +#line 676 "pars0lex.l" + + YY_BREAK +case 121: +YY_RULE_SETUP +#line 677 "pars0lex.l" +BEGIN(INITIAL); + YY_BREAK +case 122: +/* rule 122 can match eol */ +YY_RULE_SETUP +#line 679 "pars0lex.l" +/* eat up whitespace */ + YY_BREAK +case 123: +YY_RULE_SETUP +#line 682 "pars0lex.l" { fprintf(stderr,"Unrecognized character: %02x\n", *yytext); @@ -1926,12 +2104,12 @@ YY_RULE_SETUP return(0); } YY_BREAK -case 119: +case 124: YY_RULE_SETUP -#line 648 "pars0lex.l" +#line 691 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1916 "lexyy.c" +#line 2113 "lexyy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2121,7 +2299,7 @@ static int yy_get_next_buffer (void) else { - size_t num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2135,16 +2313,16 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) + b->yy_ch_buf = (char*) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc((void*) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2190,6 +2368,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char*) yyrealloc((void*) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -2205,7 +2391,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -2219,7 +2405,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 >= 399 ) + if ( yy_current_state >= 424 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2247,11 +2433,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 >= 399 ) + if ( yy_current_state >= 424 ) 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 == 398); + yy_is_jam = (yy_current_state == 423); return yy_is_jam ? 0 : yy_current_state; } @@ -2265,7 +2451,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -2280,7 +2466,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2304,7 +2490,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2322,7 +2508,7 @@ static int yy_get_next_buffer (void) } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + c = *(unsigned char*) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); @@ -2332,12 +2518,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - static void yyrestart (FILE * input_file ) + void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -2350,11 +2536,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ __attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); @@ -2394,13 +2580,13 @@ static void yy_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ static YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2410,7 +2596,7 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char*) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2423,11 +2609,11 @@ static void yy_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ - static void yy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2435,9 +2621,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree((void*) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree((void*) b ); } /* Initializes or reinitializes a buffer. @@ -2448,7 +2634,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - + yy_flush_buffer(b ); b->yy_input_file = file; @@ -2464,15 +2650,15 @@ static void yy_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - static void yy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2499,9 +2685,9 @@ static void yy_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -__attribute__((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; @@ -2529,9 +2715,9 @@ __attribute__((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buf /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -__attribute__((unused)) static void yypop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; @@ -2552,8 +2738,8 @@ __attribute__((unused)) static void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; - + yy_size_t num_to_alloc; + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -2561,12 +2747,14 @@ static void yyensure_buffer_stack (void) * immediate realloc on the next call. */ num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (yy_buffer_stack) = (struct yy_buffer_state**) yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2578,10 +2766,12 @@ static void yyensure_buffer_stack (void) int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + (yy_buffer_stack) = (struct yy_buffer_state**) yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2619,87 +2809,115 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -__attribute__((unused)) static int yyget_lineno (void) +int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ -__attribute__((unused)) static FILE *yyget_in (void) +FILE *yyget_in (void) { return yyin; } /** Get the output stream. - * + * */ -__attribute__((unused)) static FILE *yyget_out (void) +FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. - * + * */ -__attribute__((unused)) static int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. - * + * */ -__attribute__((unused)) static char *yyget_text (void) +char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number - * + * */ -__attribute__((unused)) static void yyset_lineno (int line_number ) +void yyset_lineno (int line_number ) { - + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see yy_switch_to_buffer */ -__attribute__((unused)) static void yyset_in (FILE * in_str ) +void yyset_in (FILE * in_str ) { yyin = in_str ; } -__attribute__((unused)) static void yyset_out (FILE * out_str ) +void yyset_out (FILE * out_str ) { yyout = out_str ; } -__attribute__((unused)) static int yyget_debug (void) +int yyget_debug (void) { return yy_flex_debug; } -__attribute__((unused)) static void yyset_debug (int bdebug ) +void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char*) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE*) 0; + yyout = (FILE*) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + /* yylex_destroy is for both reentrant and non-reentrant scanners. */ __attribute__((unused)) static int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); @@ -2711,6 +2929,10 @@ __attribute__((unused)) static int yylex_destroy (void) yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; } @@ -2722,7 +2944,7 @@ __attribute__((unused)) static int yylex_destroy (void) static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif @@ -2731,51 +2953,38 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static int yy_flex_strlen (yyconst char * s ) { register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; } #endif -static void *yyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void*) malloc( size ); } -static void *yyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both + /* The cast to (char*) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return (void*) realloc( (char*) ptr, size ); } -static void yyfree (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char*) ptr ); /* see yyrealloc() for (char*) cast */ } #define YYTABLES_NAME "yytables" -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef yytext_ptr -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif -#line 648 "pars0lex.l" - +#line 691 "pars0lex.l" @@ -2791,3 +3000,4 @@ pars_lexer_close(void) stringbuf = NULL; stringbuf_len_alloc = stringbuf_len = 0; } + diff --git a/storage/innobase/pars/make_bison.sh b/storage/innobase/pars/make_bison.sh index 09bb86e3106..2618be102bc 100755 --- a/storage/innobase/pars/make_bison.sh +++ b/storage/innobase/pars/make_bison.sh @@ -1,24 +1,24 @@ #!/bin/bash # -# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved. -# +# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. +# # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA # # generate parser files from bison input files. set -eu TMPFILE=pars0grm.tab.c -OUTFILE=pars0grm.c +OUTFILE=pars0grm.cc bison -d pars0grm.y mv pars0grm.tab.h ../include/pars0grm.h diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index 89308a6636f..581fc2342aa 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,25 +1,25 @@ #!/bin/bash # -# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved. -# +# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. +# # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA 02111-1307 USA +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA # # generate lexer files from flex input files. set -eu -TMPFILE=_flex_tmp.c -OUTFILE=lexyy.c +TMPFILE=_flex_tmp.cc +OUTFILE=lexyy.cc flex -o $TMPFILE pars0lex.l diff --git a/storage/innobase/pars/pars0grm.c b/storage/innobase/pars/pars0grm.c deleted file mode 100644 index d667970735e..00000000000 --- a/storage/innobase/pars/pars0grm.c +++ /dev/null @@ -1,2601 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved. -Copyright (c) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software -Foundation, Inc. - -As a special exception, when this file is copied by Bison into a -Bison output file, you may use that output file without restriction. -This special exception was added by the Free Software Foundation -in version 1.24 of Bison. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA - -*****************************************************************************/ - -/* A Bison parser, made by GNU Bison 2.0. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - PARS_INT_LIT = 258, - PARS_FLOAT_LIT = 259, - PARS_STR_LIT = 260, - PARS_FIXBINARY_LIT = 261, - PARS_BLOB_LIT = 262, - PARS_NULL_LIT = 263, - PARS_ID_TOKEN = 264, - PARS_AND_TOKEN = 265, - PARS_OR_TOKEN = 266, - PARS_NOT_TOKEN = 267, - PARS_GE_TOKEN = 268, - PARS_LE_TOKEN = 269, - PARS_NE_TOKEN = 270, - PARS_PROCEDURE_TOKEN = 271, - PARS_IN_TOKEN = 272, - PARS_OUT_TOKEN = 273, - PARS_BINARY_TOKEN = 274, - PARS_BLOB_TOKEN = 275, - PARS_INT_TOKEN = 276, - PARS_INTEGER_TOKEN = 277, - PARS_FLOAT_TOKEN = 278, - PARS_CHAR_TOKEN = 279, - PARS_IS_TOKEN = 280, - PARS_BEGIN_TOKEN = 281, - PARS_END_TOKEN = 282, - PARS_IF_TOKEN = 283, - PARS_THEN_TOKEN = 284, - PARS_ELSE_TOKEN = 285, - PARS_ELSIF_TOKEN = 286, - PARS_LOOP_TOKEN = 287, - PARS_WHILE_TOKEN = 288, - PARS_RETURN_TOKEN = 289, - PARS_SELECT_TOKEN = 290, - PARS_SUM_TOKEN = 291, - PARS_COUNT_TOKEN = 292, - PARS_DISTINCT_TOKEN = 293, - PARS_FROM_TOKEN = 294, - PARS_WHERE_TOKEN = 295, - PARS_FOR_TOKEN = 296, - PARS_DDOT_TOKEN = 297, - PARS_READ_TOKEN = 298, - PARS_ORDER_TOKEN = 299, - PARS_BY_TOKEN = 300, - PARS_ASC_TOKEN = 301, - PARS_DESC_TOKEN = 302, - PARS_INSERT_TOKEN = 303, - PARS_INTO_TOKEN = 304, - PARS_VALUES_TOKEN = 305, - PARS_UPDATE_TOKEN = 306, - PARS_SET_TOKEN = 307, - PARS_DELETE_TOKEN = 308, - PARS_CURRENT_TOKEN = 309, - PARS_OF_TOKEN = 310, - PARS_CREATE_TOKEN = 311, - PARS_TABLE_TOKEN = 312, - PARS_INDEX_TOKEN = 313, - PARS_UNIQUE_TOKEN = 314, - PARS_CLUSTERED_TOKEN = 315, - PARS_DOES_NOT_FIT_IN_MEM_TOKEN = 316, - PARS_ON_TOKEN = 317, - PARS_ASSIGN_TOKEN = 318, - PARS_DECLARE_TOKEN = 319, - PARS_CURSOR_TOKEN = 320, - PARS_SQL_TOKEN = 321, - PARS_OPEN_TOKEN = 322, - PARS_FETCH_TOKEN = 323, - PARS_CLOSE_TOKEN = 324, - PARS_NOTFOUND_TOKEN = 325, - PARS_TO_CHAR_TOKEN = 326, - PARS_TO_NUMBER_TOKEN = 327, - PARS_TO_BINARY_TOKEN = 328, - PARS_BINARY_TO_NUMBER_TOKEN = 329, - PARS_SUBSTR_TOKEN = 330, - PARS_REPLSTR_TOKEN = 331, - PARS_CONCAT_TOKEN = 332, - PARS_INSTR_TOKEN = 333, - PARS_LENGTH_TOKEN = 334, - PARS_SYSDATE_TOKEN = 335, - PARS_PRINTF_TOKEN = 336, - PARS_ASSERT_TOKEN = 337, - PARS_RND_TOKEN = 338, - PARS_RND_STR_TOKEN = 339, - PARS_ROW_PRINTF_TOKEN = 340, - PARS_COMMIT_TOKEN = 341, - PARS_ROLLBACK_TOKEN = 342, - PARS_WORK_TOKEN = 343, - PARS_UNSIGNED_TOKEN = 344, - PARS_EXIT_TOKEN = 345, - PARS_FUNCTION_TOKEN = 346, - PARS_LOCK_TOKEN = 347, - PARS_SHARE_TOKEN = 348, - PARS_MODE_TOKEN = 349, - NEG = 350 - }; -#endif -#define PARS_INT_LIT 258 -#define PARS_FLOAT_LIT 259 -#define PARS_STR_LIT 260 -#define PARS_FIXBINARY_LIT 261 -#define PARS_BLOB_LIT 262 -#define PARS_NULL_LIT 263 -#define PARS_ID_TOKEN 264 -#define PARS_AND_TOKEN 265 -#define PARS_OR_TOKEN 266 -#define PARS_NOT_TOKEN 267 -#define PARS_GE_TOKEN 268 -#define PARS_LE_TOKEN 269 -#define PARS_NE_TOKEN 270 -#define PARS_PROCEDURE_TOKEN 271 -#define PARS_IN_TOKEN 272 -#define PARS_OUT_TOKEN 273 -#define PARS_BINARY_TOKEN 274 -#define PARS_BLOB_TOKEN 275 -#define PARS_INT_TOKEN 276 -#define PARS_INTEGER_TOKEN 277 -#define PARS_FLOAT_TOKEN 278 -#define PARS_CHAR_TOKEN 279 -#define PARS_IS_TOKEN 280 -#define PARS_BEGIN_TOKEN 281 -#define PARS_END_TOKEN 282 -#define PARS_IF_TOKEN 283 -#define PARS_THEN_TOKEN 284 -#define PARS_ELSE_TOKEN 285 -#define PARS_ELSIF_TOKEN 286 -#define PARS_LOOP_TOKEN 287 -#define PARS_WHILE_TOKEN 288 -#define PARS_RETURN_TOKEN 289 -#define PARS_SELECT_TOKEN 290 -#define PARS_SUM_TOKEN 291 -#define PARS_COUNT_TOKEN 292 -#define PARS_DISTINCT_TOKEN 293 -#define PARS_FROM_TOKEN 294 -#define PARS_WHERE_TOKEN 295 -#define PARS_FOR_TOKEN 296 -#define PARS_DDOT_TOKEN 297 -#define PARS_READ_TOKEN 298 -#define PARS_ORDER_TOKEN 299 -#define PARS_BY_TOKEN 300 -#define PARS_ASC_TOKEN 301 -#define PARS_DESC_TOKEN 302 -#define PARS_INSERT_TOKEN 303 -#define PARS_INTO_TOKEN 304 -#define PARS_VALUES_TOKEN 305 -#define PARS_UPDATE_TOKEN 306 -#define PARS_SET_TOKEN 307 -#define PARS_DELETE_TOKEN 308 -#define PARS_CURRENT_TOKEN 309 -#define PARS_OF_TOKEN 310 -#define PARS_CREATE_TOKEN 311 -#define PARS_TABLE_TOKEN 312 -#define PARS_INDEX_TOKEN 313 -#define PARS_UNIQUE_TOKEN 314 -#define PARS_CLUSTERED_TOKEN 315 -#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 316 -#define PARS_ON_TOKEN 317 -#define PARS_ASSIGN_TOKEN 318 -#define PARS_DECLARE_TOKEN 319 -#define PARS_CURSOR_TOKEN 320 -#define PARS_SQL_TOKEN 321 -#define PARS_OPEN_TOKEN 322 -#define PARS_FETCH_TOKEN 323 -#define PARS_CLOSE_TOKEN 324 -#define PARS_NOTFOUND_TOKEN 325 -#define PARS_TO_CHAR_TOKEN 326 -#define PARS_TO_NUMBER_TOKEN 327 -#define PARS_TO_BINARY_TOKEN 328 -#define PARS_BINARY_TO_NUMBER_TOKEN 329 -#define PARS_SUBSTR_TOKEN 330 -#define PARS_REPLSTR_TOKEN 331 -#define PARS_CONCAT_TOKEN 332 -#define PARS_INSTR_TOKEN 333 -#define PARS_LENGTH_TOKEN 334 -#define PARS_SYSDATE_TOKEN 335 -#define PARS_PRINTF_TOKEN 336 -#define PARS_ASSERT_TOKEN 337 -#define PARS_RND_TOKEN 338 -#define PARS_RND_STR_TOKEN 339 -#define PARS_ROW_PRINTF_TOKEN 340 -#define PARS_COMMIT_TOKEN 341 -#define PARS_ROLLBACK_TOKEN 342 -#define PARS_WORK_TOKEN 343 -#define PARS_UNSIGNED_TOKEN 344 -#define PARS_EXIT_TOKEN 345 -#define PARS_FUNCTION_TOKEN 346 -#define PARS_LOCK_TOKEN 347 -#define PARS_SHARE_TOKEN 348 -#define PARS_MODE_TOKEN 349 -#define NEG 350 - - - - -/* Copy the first part of user declarations. */ -#line 13 "pars0grm.y" - -/* The value of the semantic attribute is a pointer to a query tree node -que_node_t */ - -#include "univ.i" -#include <math.h> /* Can't be before univ.i */ -#include "pars0pars.h" -#include "mem0mem.h" -#include "que0types.h" -#include "que0que.h" -#include "row0sel.h" - -#define YYSTYPE que_node_t* - -/* #define __STDC__ */ - -int -yylex(void); - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -typedef int YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 213 of yacc.c. */ -#line 297 "pars0grm.c" - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 5 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 752 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 111 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 70 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 175 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 339 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 350 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -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, 103, 2, 2, - 105, 106, 100, 99, 108, 98, 2, 101, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 104, - 96, 95, 97, 107, 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, 109, 2, 110, 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, 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, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 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, 90, 91, 92, 93, 94, - 102 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 6, 8, 11, 14, 17, 20, 23, - 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, - 56, 59, 62, 65, 68, 71, 73, 76, 78, 83, - 85, 87, 89, 91, 93, 95, 97, 101, 105, 109, - 113, 116, 120, 124, 128, 132, 136, 140, 144, 148, - 152, 155, 159, 163, 165, 167, 169, 171, 173, 175, - 177, 179, 181, 183, 185, 186, 188, 192, 199, 204, - 206, 208, 210, 214, 216, 220, 221, 223, 227, 228, - 230, 234, 236, 241, 247, 252, 253, 255, 259, 261, - 265, 267, 268, 271, 272, 275, 276, 281, 282, 284, - 286, 287, 292, 301, 305, 311, 314, 318, 320, 324, - 329, 334, 337, 340, 344, 347, 350, 353, 357, 362, - 364, 367, 368, 371, 373, 381, 388, 399, 401, 403, - 406, 409, 414, 419, 425, 427, 431, 432, 436, 437, - 439, 440, 443, 444, 446, 454, 456, 460, 461, 463, - 464, 466, 477, 480, 483, 485, 487, 489, 491, 493, - 497, 501, 502, 504, 508, 512, 513, 515, 518, 525, - 530, 532, 534, 535, 537, 540 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 112, 0, -1, 180, 104, -1, 118, -1, 119, 104, - -1, 151, 104, -1, 152, 104, -1, 153, 104, -1, - 150, 104, -1, 154, 104, -1, 146, 104, -1, 133, - 104, -1, 135, 104, -1, 145, 104, -1, 143, 104, - -1, 144, 104, -1, 140, 104, -1, 141, 104, -1, - 155, 104, -1, 157, 104, -1, 156, 104, -1, 169, - 104, -1, 170, 104, -1, 164, 104, -1, 168, 104, - -1, 113, -1, 114, 113, -1, 9, -1, 116, 105, - 124, 106, -1, 3, -1, 4, -1, 5, -1, 6, - -1, 7, -1, 8, -1, 66, -1, 115, 99, 115, - -1, 115, 98, 115, -1, 115, 100, 115, -1, 115, - 101, 115, -1, 98, 115, -1, 105, 115, 106, -1, - 115, 95, 115, -1, 115, 96, 115, -1, 115, 97, - 115, -1, 115, 13, 115, -1, 115, 14, 115, -1, - 115, 15, 115, -1, 115, 10, 115, -1, 115, 11, - 115, -1, 12, 115, -1, 9, 103, 70, -1, 66, - 103, 70, -1, 71, -1, 72, -1, 73, -1, 74, - -1, 75, -1, 77, -1, 78, -1, 79, -1, 80, - -1, 83, -1, 84, -1, -1, 107, -1, 117, 108, - 107, -1, 109, 9, 105, 117, 106, 110, -1, 120, - 105, 124, 106, -1, 76, -1, 81, -1, 82, -1, - 9, 105, 106, -1, 9, -1, 122, 108, 9, -1, - -1, 9, -1, 123, 108, 9, -1, -1, 115, -1, - 124, 108, 115, -1, 115, -1, 37, 105, 100, 106, - -1, 37, 105, 38, 9, 106, -1, 36, 105, 115, - 106, -1, -1, 125, -1, 126, 108, 125, -1, 100, - -1, 126, 49, 123, -1, 126, -1, -1, 40, 115, - -1, -1, 41, 51, -1, -1, 92, 17, 93, 94, - -1, -1, 46, -1, 47, -1, -1, 44, 45, 9, - 131, -1, 35, 127, 39, 122, 128, 129, 130, 132, - -1, 48, 49, 9, -1, 134, 50, 105, 124, 106, - -1, 134, 133, -1, 9, 95, 115, -1, 136, -1, - 137, 108, 136, -1, 40, 54, 55, 9, -1, 51, - 9, 52, 137, -1, 139, 128, -1, 139, 138, -1, - 53, 39, 9, -1, 142, 128, -1, 142, 138, -1, - 85, 133, -1, 9, 63, 115, -1, 31, 115, 29, - 114, -1, 147, -1, 148, 147, -1, -1, 30, 114, - -1, 148, -1, 28, 115, 29, 114, 149, 27, 28, - -1, 33, 115, 32, 114, 27, 32, -1, 41, 9, - 17, 115, 42, 115, 32, 114, 27, 32, -1, 90, - -1, 34, -1, 67, 9, -1, 69, 9, -1, 68, - 9, 49, 123, -1, 68, 9, 49, 121, -1, 9, - 171, 160, 161, 162, -1, 158, -1, 159, 108, 158, - -1, -1, 105, 3, 106, -1, -1, 89, -1, -1, - 12, 8, -1, -1, 61, -1, 56, 57, 9, 105, - 159, 106, 163, -1, 9, -1, 165, 108, 9, -1, - -1, 59, -1, -1, 60, -1, 56, 166, 167, 58, - 9, 62, 9, 105, 165, 106, -1, 86, 88, -1, - 87, 88, -1, 21, -1, 22, -1, 24, -1, 19, - -1, 20, -1, 9, 17, 171, -1, 9, 18, 171, - -1, -1, 172, -1, 173, 108, 172, -1, 9, 171, - 104, -1, -1, 174, -1, 175, 174, -1, 64, 65, - 9, 25, 133, 104, -1, 64, 91, 9, 104, -1, - 176, -1, 177, -1, -1, 178, -1, 179, 178, -1, - 16, 9, 105, 173, 106, 25, 175, 179, 26, 114, - 27, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 138, 138, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 166, 167, 172, 173, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 199, 204, 205, 206, 207, 209, 210, 211, - 212, 213, 214, 215, 218, 220, 221, 225, 230, 235, - 236, 237, 241, 245, 246, 251, 252, 253, 258, 259, - 260, 264, 265, 270, 276, 283, 284, 285, 290, 292, - 294, 298, 299, 303, 304, 309, 310, 315, 316, 317, - 321, 322, 327, 337, 342, 344, 349, 353, 354, 359, - 365, 372, 377, 382, 388, 393, 398, 403, 408, 414, - 415, 420, 421, 423, 427, 434, 440, 448, 452, 456, - 462, 468, 470, 475, 480, 481, 486, 487, 492, 493, - 499, 500, 506, 507, 513, 519, 520, 525, 526, 530, - 531, 535, 543, 548, 553, 554, 555, 556, 557, 561, - 564, 570, 571, 572, 577, 581, 583, 584, 588, 594, - 599, 600, 603, 605, 606, 610 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "PARS_INT_LIT", "PARS_FLOAT_LIT", - "PARS_STR_LIT", "PARS_FIXBINARY_LIT", "PARS_BLOB_LIT", "PARS_NULL_LIT", - "PARS_ID_TOKEN", "PARS_AND_TOKEN", "PARS_OR_TOKEN", "PARS_NOT_TOKEN", - "PARS_GE_TOKEN", "PARS_LE_TOKEN", "PARS_NE_TOKEN", - "PARS_PROCEDURE_TOKEN", "PARS_IN_TOKEN", "PARS_OUT_TOKEN", - "PARS_BINARY_TOKEN", "PARS_BLOB_TOKEN", "PARS_INT_TOKEN", - "PARS_INTEGER_TOKEN", "PARS_FLOAT_TOKEN", "PARS_CHAR_TOKEN", - "PARS_IS_TOKEN", "PARS_BEGIN_TOKEN", "PARS_END_TOKEN", "PARS_IF_TOKEN", - "PARS_THEN_TOKEN", "PARS_ELSE_TOKEN", "PARS_ELSIF_TOKEN", - "PARS_LOOP_TOKEN", "PARS_WHILE_TOKEN", "PARS_RETURN_TOKEN", - "PARS_SELECT_TOKEN", "PARS_SUM_TOKEN", "PARS_COUNT_TOKEN", - "PARS_DISTINCT_TOKEN", "PARS_FROM_TOKEN", "PARS_WHERE_TOKEN", - "PARS_FOR_TOKEN", "PARS_DDOT_TOKEN", "PARS_READ_TOKEN", - "PARS_ORDER_TOKEN", "PARS_BY_TOKEN", "PARS_ASC_TOKEN", "PARS_DESC_TOKEN", - "PARS_INSERT_TOKEN", "PARS_INTO_TOKEN", "PARS_VALUES_TOKEN", - "PARS_UPDATE_TOKEN", "PARS_SET_TOKEN", "PARS_DELETE_TOKEN", - "PARS_CURRENT_TOKEN", "PARS_OF_TOKEN", "PARS_CREATE_TOKEN", - "PARS_TABLE_TOKEN", "PARS_INDEX_TOKEN", "PARS_UNIQUE_TOKEN", - "PARS_CLUSTERED_TOKEN", "PARS_DOES_NOT_FIT_IN_MEM_TOKEN", - "PARS_ON_TOKEN", "PARS_ASSIGN_TOKEN", "PARS_DECLARE_TOKEN", - "PARS_CURSOR_TOKEN", "PARS_SQL_TOKEN", "PARS_OPEN_TOKEN", - "PARS_FETCH_TOKEN", "PARS_CLOSE_TOKEN", "PARS_NOTFOUND_TOKEN", - "PARS_TO_CHAR_TOKEN", "PARS_TO_NUMBER_TOKEN", "PARS_TO_BINARY_TOKEN", - "PARS_BINARY_TO_NUMBER_TOKEN", "PARS_SUBSTR_TOKEN", "PARS_REPLSTR_TOKEN", - "PARS_CONCAT_TOKEN", "PARS_INSTR_TOKEN", "PARS_LENGTH_TOKEN", - "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", "PARS_FUNCTION_TOKEN", - "PARS_LOCK_TOKEN", "PARS_SHARE_TOKEN", "PARS_MODE_TOKEN", "'='", "'<'", - "'>'", "'-'", "'+'", "'*'", "'/'", "NEG", "'%'", "';'", "'('", "')'", - "'?'", "','", "'{'", "'}'", "$accept", "top_statement", "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", - "lock_shared_clause", "order_direction", "order_by_clause", - "select_statement", "insert_statement_start", "insert_statement", - "column_assignment", "column_assignment_list", "cursor_positioned", - "update_statement_start", "update_statement_searched", - "update_statement_positioned", "delete_statement_start", - "delete_statement_searched", "delete_statement_positioned", - "row_printf_statement", "assignment_statement", "elsif_element", - "elsif_list", "else_part", "if_statement", "while_statement", - "for_statement", "exit_statement", "return_statement", - "open_cursor_statement", "close_cursor_statement", "fetch_statement", - "column_def", "column_def_list", "opt_column_len", "opt_unsigned", - "opt_not_null", "not_fit_in_memory", "create_table", "column_list", - "unique_def", "clustered_def", "create_index", "commit_statement", - "rollback_statement", "type_name", "parameter_declaration", - "parameter_declaration_list", "variable_declaration", - "variable_declaration_list", "cursor_declaration", - "function_declaration", "declaration", "declaration_list", - "procedure_definition", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 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, - 345, 346, 347, 348, 349, 61, 60, 62, 45, 43, - 42, 47, 350, 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, 111, 112, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, - 113, 113, 113, 113, 113, 114, 114, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, - 116, 116, 116, 116, 117, 117, 117, 118, 119, 120, - 120, 120, 121, 122, 122, 123, 123, 123, 124, 124, - 124, 125, 125, 125, 125, 126, 126, 126, 127, 127, - 127, 128, 128, 129, 129, 130, 130, 131, 131, 131, - 132, 132, 133, 134, 135, 135, 136, 137, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 148, 149, 149, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 157, 158, 159, 159, 160, 160, 161, 161, - 162, 162, 163, 163, 164, 165, 165, 166, 166, 167, - 167, 168, 169, 170, 171, 171, 171, 171, 171, 172, - 172, 173, 173, 173, 174, 175, 175, 175, 176, 177, - 178, 178, 179, 179, 179, 180 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 2, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - 2, 3, 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, 3, 1, 3, 0, 1, 3, 0, 1, - 3, 1, 4, 5, 4, 0, 1, 3, 1, 3, - 1, 0, 2, 0, 2, 0, 4, 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 - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 0, 0, 0, 0, 0, 1, 2, 161, 0, 162, - 0, 0, 0, 0, 0, 157, 158, 154, 155, 156, - 159, 160, 165, 163, 0, 166, 172, 0, 0, 167, - 170, 171, 173, 0, 164, 0, 0, 0, 174, 0, - 0, 0, 0, 0, 128, 85, 0, 0, 0, 0, - 147, 0, 0, 0, 69, 70, 71, 0, 0, 0, - 127, 0, 25, 0, 3, 0, 0, 0, 0, 0, - 91, 0, 0, 91, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 0, 29, 30, 31, 32, 33, 34, 27, - 0, 35, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 0, 0, 0, 0, 0, 0, 0, - 88, 81, 86, 90, 0, 0, 0, 0, 0, 0, - 148, 149, 129, 0, 130, 116, 152, 153, 0, 175, - 26, 4, 78, 11, 0, 105, 12, 0, 111, 112, - 16, 17, 114, 115, 14, 15, 13, 10, 8, 5, - 6, 7, 9, 18, 20, 19, 23, 24, 21, 22, - 0, 117, 0, 50, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 0, 75, 0, 0, 0, 103, 0, - 113, 0, 150, 0, 75, 64, 79, 0, 78, 0, - 92, 168, 51, 52, 41, 48, 49, 45, 46, 47, - 121, 42, 43, 44, 37, 36, 38, 39, 0, 0, - 0, 0, 0, 76, 89, 87, 73, 91, 0, 0, - 107, 110, 0, 0, 76, 132, 131, 65, 0, 68, - 0, 0, 0, 0, 0, 119, 123, 0, 28, 0, - 84, 0, 82, 0, 0, 0, 93, 0, 0, 0, - 0, 134, 0, 0, 0, 0, 0, 80, 104, 109, - 122, 0, 120, 0, 125, 83, 77, 74, 0, 95, - 0, 106, 108, 136, 142, 0, 0, 72, 67, 66, - 0, 124, 94, 0, 100, 0, 0, 138, 143, 144, - 135, 0, 118, 0, 0, 102, 0, 0, 139, 140, - 0, 0, 0, 0, 137, 0, 133, 145, 0, 96, - 97, 126, 141, 151, 0, 98, 99, 101, 146 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 2, 62, 63, 206, 116, 248, 64, 65, 66, - 245, 237, 234, 207, 122, 123, 124, 148, 289, 304, - 337, 315, 67, 68, 69, 240, 241, 149, 70, 71, - 72, 73, 74, 75, 76, 77, 255, 256, 257, 78, - 79, 80, 81, 82, 83, 84, 85, 271, 272, 307, - 319, 326, 309, 86, 328, 131, 203, 87, 88, 89, - 20, 9, 10, 25, 26, 30, 31, 32, 33, 3 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -177 -static const short int yypact[] = -{ - 28, 38, 54, -46, -29, -177, -177, 56, 50, -177, - -75, 8, 8, 46, 56, -177, -177, -177, -177, -177, - -177, -177, 63, -177, 8, -177, 2, -26, -51, -177, - -177, -177, -177, -13, -177, 71, 72, 587, -177, 57, - -21, 26, 272, 272, -177, 13, 91, 55, 96, 67, - -22, 99, 100, 103, -177, -177, -177, 75, 29, 35, - -177, 116, -177, 396, -177, 22, 23, 27, -9, 30, - 87, 31, 32, 87, 47, 49, 52, 58, 59, 60, - 61, 62, 65, 66, 74, 77, 78, 86, 89, 102, - 75, -177, 272, -177, -177, -177, -177, -177, -177, 39, - 272, 51, -177, -177, -177, -177, -177, -177, -177, -177, - -177, -177, -177, 272, 272, 361, 25, 489, 45, 90, - -177, 651, -177, -39, 93, 142, 124, 108, 152, 170, - -177, 131, -177, 143, -177, -177, -177, -177, 98, -177, - -177, -177, 272, -177, 110, -177, -177, 256, -177, -177, - -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, - -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, - 112, 651, 137, 101, 147, 204, 88, 272, 272, 272, - 272, 272, 587, 272, 272, 272, 272, 272, 272, 272, - 272, 587, 272, -30, 211, 168, 212, 272, -177, 213, - -177, 118, -177, 167, 217, 122, 651, -63, 272, 175, - 651, -177, -177, -177, -177, 101, 101, 21, 21, 651, - 332, 21, 21, 21, -6, -6, 204, 204, -60, 460, - 198, 222, 126, -177, 125, -177, -177, -33, 584, 140, - -177, 128, 228, 229, 139, -177, 125, -177, -53, -177, - 272, -49, 240, 587, 272, -177, 224, 226, -177, 225, - -177, 150, -177, 258, 272, 260, 230, 272, 272, 213, - 8, -177, -45, 208, 166, 164, 176, 651, -177, -177, - 587, 631, -177, 254, -177, -177, -177, -177, 234, 194, - 638, 651, -177, 182, 227, 228, 280, -177, -177, -177, - 587, -177, -177, 273, 247, 587, 289, 214, -177, -177, - -177, 195, 587, 209, 261, -177, 524, 199, -177, 295, - 292, 215, 299, 279, -177, 304, -177, -177, -44, -177, - -8, -177, -177, -177, 305, -177, -177, -177, -177 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -177, -177, -62, -176, -40, -177, -177, -177, -177, -177, - -177, -177, 109, -166, 120, -177, -177, -69, -177, -177, - -177, -177, -34, -177, -177, 48, -177, 243, -177, -177, - -177, -177, -177, -177, -177, -177, 64, -177, -177, -177, - -177, -177, -177, -177, -177, -177, -177, 24, -177, -177, - -177, -177, -177, -177, -177, -177, -177, -177, -177, -177, - -12, 307, -177, 297, -177, -177, -177, 285, -177, -177 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const unsigned short int yytable[] = -{ - 21, 140, 115, 117, 152, 121, 220, 264, 231, 181, - 194, 24, 27, 37, 35, 229, 93, 94, 95, 96, - 97, 98, 99, 135, 228, 100, 45, 15, 16, 17, - 18, 13, 19, 14, 145, 129, 181, 130, 335, 336, - 36, 144, 251, 249, 1, 250, 258, 4, 250, 118, - 119, 28, 171, 275, 5, 276, 170, 278, 6, 250, - 173, 294, 333, 295, 334, 8, 28, 11, 12, 195, - 232, 22, 24, 175, 176, 265, 7, 280, 34, 101, - 39, 40, 90, 91, 102, 103, 104, 105, 106, 92, - 107, 108, 109, 110, 188, 189, 111, 112, 177, 178, - 125, 179, 180, 181, 126, 127, 128, 210, 132, 133, - 45, 113, 134, 120, 179, 180, 181, 136, 114, 186, - 187, 188, 189, 137, 312, 138, 141, 147, 142, 316, - 190, 143, 196, 198, 146, 150, 151, 215, 216, 217, - 218, 219, 172, 221, 222, 223, 224, 225, 226, 227, - 192, 154, 230, 155, 174, 121, 156, 238, 140, 197, - 199, 200, 157, 158, 159, 160, 161, 140, 266, 162, - 163, 93, 94, 95, 96, 97, 98, 99, 164, 201, - 100, 165, 166, 183, 184, 185, 186, 187, 188, 189, - 167, 202, 204, 168, 214, 193, 183, 184, 185, 186, - 187, 188, 189, 205, 118, 119, 169, 212, 177, 178, - 277, 179, 180, 181, 281, 208, 211, 213, 140, 181, - 233, 236, 239, 242, 210, 243, 244, 290, 291, 247, - 252, 261, 262, 263, 101, 268, 269, 270, 273, 102, - 103, 104, 105, 106, 274, 107, 108, 109, 110, 279, - 140, 111, 112, 283, 140, 254, 285, 284, 293, 93, - 94, 95, 96, 97, 98, 99, 113, 286, 100, 287, - 296, 288, 297, 114, 298, 93, 94, 95, 96, 97, - 98, 99, 301, 299, 100, 302, 303, 306, 308, 311, - 313, 314, 317, 183, 184, 185, 186, 187, 188, 189, - 320, 327, 321, 318, 260, 324, 322, 325, 330, 329, - 209, 331, 332, 246, 338, 235, 153, 292, 38, 310, - 282, 23, 101, 29, 0, 0, 0, 102, 103, 104, - 105, 106, 0, 107, 108, 109, 110, 0, 101, 111, - 112, 41, 0, 102, 103, 104, 105, 106, 0, 107, - 108, 109, 110, 0, 113, 111, 112, 0, 0, 0, - 42, 114, 253, 254, 0, 43, 44, 45, 0, 0, - 113, 177, 178, 46, 179, 180, 181, 114, 0, 0, - 47, 0, 0, 48, 0, 49, 0, 0, 50, 0, - 182, 0, 0, 0, 0, 0, 0, 0, 0, 51, - 52, 53, 0, 0, 0, 41, 0, 0, 54, 0, - 0, 0, 0, 55, 56, 0, 0, 57, 58, 59, - 0, 0, 60, 139, 42, 0, 0, 0, 0, 43, - 44, 45, 0, 0, 0, 0, 0, 46, 0, 0, - 0, 61, 0, 0, 47, 0, 0, 48, 0, 49, - 0, 0, 50, 0, 0, 0, 183, 184, 185, 186, - 187, 188, 189, 51, 52, 53, 0, 0, 0, 41, - 0, 0, 54, 0, 0, 0, 0, 55, 56, 0, - 0, 57, 58, 59, 0, 0, 60, 259, 42, 0, - 0, 0, 0, 43, 44, 45, 0, 0, 0, 177, - 178, 46, 179, 180, 181, 61, 0, 0, 47, 0, - 0, 48, 0, 49, 0, 0, 50, 0, 0, 0, - 0, 191, 0, 0, 0, 0, 0, 51, 52, 53, - 0, 0, 0, 41, 0, 0, 54, 0, 0, 0, - 0, 55, 56, 0, 0, 57, 58, 59, 0, 0, - 60, 323, 42, 0, 0, 0, 0, 43, 44, 45, - 0, 0, 0, 0, 0, 46, 0, 0, 0, 61, - 0, 0, 47, 0, 0, 48, 0, 49, 0, 0, - 50, 0, 0, 0, 183, 184, 185, 186, 187, 188, - 189, 51, 52, 53, 177, 178, 41, 179, 180, 181, - 54, 0, 0, 0, 0, 55, 56, 0, 0, 57, - 58, 59, 0, 0, 60, 42, 0, 0, 0, 0, - 43, 44, 45, 0, 0, 0, 267, 0, 46, 0, - 0, 0, 0, 61, 0, 47, 0, 0, 48, 0, - 49, 177, 178, 50, 179, 180, 181, 0, 177, 178, - 0, 179, 180, 181, 51, 52, 53, 0, 0, 0, - 300, 177, 178, 54, 179, 180, 181, 0, 55, 56, - 305, 0, 57, 58, 59, 0, 0, 60, 0, 183, - 184, 185, 186, 187, 188, 189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 61, 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, 183, 184, 185, 186, - 187, 188, 189, 183, 184, 185, 186, 187, 188, 189, - 0, 0, 0, 0, 0, 0, 183, 184, 185, 186, - 187, 188, 189 -}; - -static const short int yycheck[] = -{ - 12, 63, 42, 43, 73, 45, 182, 40, 38, 15, - 49, 9, 24, 26, 65, 191, 3, 4, 5, 6, - 7, 8, 9, 57, 190, 12, 35, 19, 20, 21, - 22, 106, 24, 108, 68, 57, 15, 59, 46, 47, - 91, 50, 208, 106, 16, 108, 106, 9, 108, 36, - 37, 64, 92, 106, 0, 108, 90, 106, 104, 108, - 100, 106, 106, 108, 108, 9, 64, 17, 18, 108, - 100, 25, 9, 113, 114, 108, 105, 253, 104, 66, - 9, 9, 25, 104, 71, 72, 73, 74, 75, 63, - 77, 78, 79, 80, 100, 101, 83, 84, 10, 11, - 9, 13, 14, 15, 49, 9, 39, 147, 9, 9, - 35, 98, 9, 100, 13, 14, 15, 88, 105, 98, - 99, 100, 101, 88, 300, 9, 104, 40, 105, 305, - 105, 104, 39, 9, 104, 104, 104, 177, 178, 179, - 180, 181, 103, 183, 184, 185, 186, 187, 188, 189, - 105, 104, 192, 104, 103, 195, 104, 197, 220, 17, - 52, 9, 104, 104, 104, 104, 104, 229, 237, 104, - 104, 3, 4, 5, 6, 7, 8, 9, 104, 9, - 12, 104, 104, 95, 96, 97, 98, 99, 100, 101, - 104, 60, 49, 104, 106, 105, 95, 96, 97, 98, - 99, 100, 101, 105, 36, 37, 104, 70, 10, 11, - 250, 13, 14, 15, 254, 105, 104, 70, 280, 15, - 9, 9, 9, 105, 264, 58, 9, 267, 268, 107, - 55, 9, 106, 108, 66, 95, 108, 9, 9, 71, - 72, 73, 74, 75, 105, 77, 78, 79, 80, 9, - 312, 83, 84, 27, 316, 31, 106, 32, 270, 3, - 4, 5, 6, 7, 8, 9, 98, 9, 12, 9, - 62, 41, 106, 105, 110, 3, 4, 5, 6, 7, - 8, 9, 28, 107, 12, 51, 92, 105, 61, 9, - 17, 44, 3, 95, 96, 97, 98, 99, 100, 101, - 105, 9, 93, 89, 106, 106, 45, 12, 9, 94, - 54, 32, 8, 204, 9, 195, 73, 269, 33, 295, - 256, 14, 66, 26, -1, -1, -1, 71, 72, 73, - 74, 75, -1, 77, 78, 79, 80, -1, 66, 83, - 84, 9, -1, 71, 72, 73, 74, 75, -1, 77, - 78, 79, 80, -1, 98, 83, 84, -1, -1, -1, - 28, 105, 30, 31, -1, 33, 34, 35, -1, -1, - 98, 10, 11, 41, 13, 14, 15, 105, -1, -1, - 48, -1, -1, 51, -1, 53, -1, -1, 56, -1, - 29, -1, -1, -1, -1, -1, -1, -1, -1, 67, - 68, 69, -1, -1, -1, 9, -1, -1, 76, -1, - -1, -1, -1, 81, 82, -1, -1, 85, 86, 87, - -1, -1, 90, 27, 28, -1, -1, -1, -1, 33, - 34, 35, -1, -1, -1, -1, -1, 41, -1, -1, - -1, 109, -1, -1, 48, -1, -1, 51, -1, 53, - -1, -1, 56, -1, -1, -1, 95, 96, 97, 98, - 99, 100, 101, 67, 68, 69, -1, -1, -1, 9, - -1, -1, 76, -1, -1, -1, -1, 81, 82, -1, - -1, 85, 86, 87, -1, -1, 90, 27, 28, -1, - -1, -1, -1, 33, 34, 35, -1, -1, -1, 10, - 11, 41, 13, 14, 15, 109, -1, -1, 48, -1, - -1, 51, -1, 53, -1, -1, 56, -1, -1, -1, - -1, 32, -1, -1, -1, -1, -1, 67, 68, 69, - -1, -1, -1, 9, -1, -1, 76, -1, -1, -1, - -1, 81, 82, -1, -1, 85, 86, 87, -1, -1, - 90, 27, 28, -1, -1, -1, -1, 33, 34, 35, - -1, -1, -1, -1, -1, 41, -1, -1, -1, 109, - -1, -1, 48, -1, -1, 51, -1, 53, -1, -1, - 56, -1, -1, -1, 95, 96, 97, 98, 99, 100, - 101, 67, 68, 69, 10, 11, 9, 13, 14, 15, - 76, -1, -1, -1, -1, 81, 82, -1, -1, 85, - 86, 87, -1, -1, 90, 28, -1, -1, -1, -1, - 33, 34, 35, -1, -1, -1, 42, -1, 41, -1, - -1, -1, -1, 109, -1, 48, -1, -1, 51, -1, - 53, 10, 11, 56, 13, 14, 15, -1, 10, 11, - -1, 13, 14, 15, 67, 68, 69, -1, -1, -1, - 29, 10, 11, 76, 13, 14, 15, -1, 81, 82, - 32, -1, 85, 86, 87, -1, -1, 90, -1, 95, - 96, 97, 98, 99, 100, 101, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 109, -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, 95, 96, 97, 98, - 99, 100, 101, 95, 96, 97, 98, 99, 100, 101, - -1, -1, -1, -1, -1, -1, 95, 96, 97, 98, - 99, 100, 101 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 16, 112, 180, 9, 0, 104, 105, 9, 172, - 173, 17, 18, 106, 108, 19, 20, 21, 22, 24, - 171, 171, 25, 172, 9, 174, 175, 171, 64, 174, - 176, 177, 178, 179, 104, 65, 91, 26, 178, 9, - 9, 9, 28, 33, 34, 35, 41, 48, 51, 53, - 56, 67, 68, 69, 76, 81, 82, 85, 86, 87, - 90, 109, 113, 114, 118, 119, 120, 133, 134, 135, - 139, 140, 141, 142, 143, 144, 145, 146, 150, 151, - 152, 153, 154, 155, 156, 157, 164, 168, 169, 170, - 25, 104, 63, 3, 4, 5, 6, 7, 8, 9, - 12, 66, 71, 72, 73, 74, 75, 77, 78, 79, - 80, 83, 84, 98, 105, 115, 116, 115, 36, 37, - 100, 115, 125, 126, 127, 9, 49, 9, 39, 57, - 59, 166, 9, 9, 9, 133, 88, 88, 9, 27, - 113, 104, 105, 104, 50, 133, 104, 40, 128, 138, - 104, 104, 128, 138, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 133, 115, 103, 115, 103, 115, 115, 10, 11, 13, - 14, 15, 29, 95, 96, 97, 98, 99, 100, 101, - 105, 32, 105, 105, 49, 108, 39, 17, 9, 52, - 9, 9, 60, 167, 49, 105, 115, 124, 105, 54, - 115, 104, 70, 70, 106, 115, 115, 115, 115, 115, - 114, 115, 115, 115, 115, 115, 115, 115, 124, 114, - 115, 38, 100, 9, 123, 125, 9, 122, 115, 9, - 136, 137, 105, 58, 9, 121, 123, 107, 117, 106, - 108, 124, 55, 30, 31, 147, 148, 149, 106, 27, - 106, 9, 106, 108, 40, 108, 128, 42, 95, 108, - 9, 158, 159, 9, 105, 106, 108, 115, 106, 9, - 114, 115, 147, 27, 32, 106, 9, 9, 41, 129, - 115, 115, 136, 171, 106, 108, 62, 106, 110, 107, - 29, 28, 51, 92, 130, 32, 105, 160, 61, 163, - 158, 9, 114, 17, 44, 132, 114, 3, 89, 161, - 105, 93, 45, 27, 106, 12, 162, 9, 165, 94, - 9, 32, 8, 106, 108, 46, 47, 131, 9 -}; - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ -while (0) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; -#endif -{ - int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -UNIV_INTERN int yyparse (void *YYPARSE_PARAM); -# else -UNIV_INTERN int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -UNIV_INTERN int yyparse (void); -#else -UNIV_INTERN int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -static int yychar; - -/* The semantic value of the look-ahead symbol. */ -UNIV_INTERN YYSTYPE yylval; - -/* Number of syntax errors so far. */ -static int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -UNIV_INTERN int yyparse (void *YYPARSE_PARAM) -# else -UNIV_INTERN int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - - - -#define YYPOPSTACK (yyvsp--, yyssp--) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - - yyvsp[0] = yylval; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to look-ahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 25: -#line 166 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 26: -#line 168 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); ;} - break; - - case 27: -#line 172 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 28: -#line 174 "pars0grm.y" - { (yyval) = pars_func((yyvsp[-3]), (yyvsp[-1])); ;} - break; - - case 29: -#line 175 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 30: -#line 176 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 31: -#line 177 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 32: -#line 178 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 33: -#line 179 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 34: -#line 180 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 35: -#line 181 "pars0grm.y" - { (yyval) = (yyvsp[0]);;} - break; - - case 36: -#line 182 "pars0grm.y" - { (yyval) = pars_op('+', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 37: -#line 183 "pars0grm.y" - { (yyval) = pars_op('-', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 38: -#line 184 "pars0grm.y" - { (yyval) = pars_op('*', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 39: -#line 185 "pars0grm.y" - { (yyval) = pars_op('/', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 40: -#line 186 "pars0grm.y" - { (yyval) = pars_op('-', (yyvsp[0]), NULL); ;} - break; - - case 41: -#line 187 "pars0grm.y" - { (yyval) = (yyvsp[-1]); ;} - break; - - case 42: -#line 188 "pars0grm.y" - { (yyval) = pars_op('=', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 43: -#line 189 "pars0grm.y" - { (yyval) = pars_op('<', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 44: -#line 190 "pars0grm.y" - { (yyval) = pars_op('>', (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 45: -#line 191 "pars0grm.y" - { (yyval) = pars_op(PARS_GE_TOKEN, (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 46: -#line 192 "pars0grm.y" - { (yyval) = pars_op(PARS_LE_TOKEN, (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 47: -#line 193 "pars0grm.y" - { (yyval) = pars_op(PARS_NE_TOKEN, (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 48: -#line 194 "pars0grm.y" - { (yyval) = pars_op(PARS_AND_TOKEN, (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 49: -#line 195 "pars0grm.y" - { (yyval) = pars_op(PARS_OR_TOKEN, (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 50: -#line 196 "pars0grm.y" - { (yyval) = pars_op(PARS_NOT_TOKEN, (yyvsp[0]), NULL); ;} - break; - - case 51: -#line 198 "pars0grm.y" - { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); ;} - break; - - case 52: -#line 200 "pars0grm.y" - { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[-2]), NULL); ;} - break; - - case 53: -#line 204 "pars0grm.y" - { (yyval) = &pars_to_char_token; ;} - break; - - case 54: -#line 205 "pars0grm.y" - { (yyval) = &pars_to_number_token; ;} - break; - - case 55: -#line 206 "pars0grm.y" - { (yyval) = &pars_to_binary_token; ;} - break; - - case 56: -#line 208 "pars0grm.y" - { (yyval) = &pars_binary_to_number_token; ;} - break; - - case 57: -#line 209 "pars0grm.y" - { (yyval) = &pars_substr_token; ;} - break; - - case 58: -#line 210 "pars0grm.y" - { (yyval) = &pars_concat_token; ;} - break; - - case 59: -#line 211 "pars0grm.y" - { (yyval) = &pars_instr_token; ;} - break; - - case 60: -#line 212 "pars0grm.y" - { (yyval) = &pars_length_token; ;} - break; - - case 61: -#line 213 "pars0grm.y" - { (yyval) = &pars_sysdate_token; ;} - break; - - case 62: -#line 214 "pars0grm.y" - { (yyval) = &pars_rnd_token; ;} - break; - - case 63: -#line 215 "pars0grm.y" - { (yyval) = &pars_rnd_str_token; ;} - break; - - case 67: -#line 226 "pars0grm.y" - { (yyval) = pars_stored_procedure_call((yyvsp[-4])); ;} - break; - - case 68: -#line 231 "pars0grm.y" - { (yyval) = pars_procedure_call((yyvsp[-3]), (yyvsp[-1])); ;} - break; - - case 69: -#line 235 "pars0grm.y" - { (yyval) = &pars_replstr_token; ;} - break; - - case 70: -#line 236 "pars0grm.y" - { (yyval) = &pars_printf_token; ;} - break; - - case 71: -#line 237 "pars0grm.y" - { (yyval) = &pars_assert_token; ;} - break; - - case 72: -#line 241 "pars0grm.y" - { (yyval) = (yyvsp[-2]); ;} - break; - - case 73: -#line 245 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 74: -#line 247 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 75: -#line 251 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 76: -#line 252 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 77: -#line 254 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 78: -#line 258 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 79: -#line 259 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0]));;} - break; - - case 80: -#line 260 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 81: -#line 264 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 82: -#line 266 "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 83: -#line 271 "pars0grm.y" - { (yyval) = pars_func(&pars_count_token, - que_node_list_add_last(NULL, - pars_func(&pars_distinct_token, - que_node_list_add_last( - NULL, (yyvsp[-1]))))); ;} - break; - - case 84: -#line 277 "pars0grm.y" - { (yyval) = pars_func(&pars_sum_token, - que_node_list_add_last(NULL, - (yyvsp[-1]))); ;} - break; - - case 85: -#line 283 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 86: -#line 284 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 87: -#line 286 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 88: -#line 290 "pars0grm.y" - { (yyval) = pars_select_list(&pars_star_denoter, - NULL); ;} - break; - - case 89: -#line 293 "pars0grm.y" - { (yyval) = pars_select_list((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 90: -#line 294 "pars0grm.y" - { (yyval) = pars_select_list((yyvsp[0]), NULL); ;} - break; - - case 91: -#line 298 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 92: -#line 299 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 93: -#line 303 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 94: -#line 305 "pars0grm.y" - { (yyval) = &pars_update_token; ;} - break; - - case 95: -#line 309 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 96: -#line 311 "pars0grm.y" - { yyval = &pars_share_token; ;} - break; - - case 97: -#line 315 "pars0grm.y" - { (yyval) = &pars_asc_token; ;} - break; - - case 98: -#line 316 "pars0grm.y" - { (yyval) = &pars_asc_token; ;} - break; - - case 99: -#line 317 "pars0grm.y" - { (yyval) = &pars_desc_token; ;} - break; - - case 100: -#line 321 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 101: -#line 323 "pars0grm.y" - { (yyval) = pars_order_by((yyvsp[-1]), (yyvsp[0])); ;} - break; - - case 102: -#line 332 "pars0grm.y" - { (yyval) = pars_select_statement((yyvsp[-6]), (yyvsp[-4]), (yyvsp[-3]), - (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); ;} - break; - - case 103: -#line 338 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 104: -#line 343 "pars0grm.y" - { (yyval) = pars_insert_statement((yyvsp[-4]), (yyvsp[-1]), NULL); ;} - break; - - case 105: -#line 345 "pars0grm.y" - { (yyval) = pars_insert_statement((yyvsp[-1]), NULL, (yyvsp[0])); ;} - break; - - case 106: -#line 349 "pars0grm.y" - { (yyval) = pars_column_assignment((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 107: -#line 353 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 108: -#line 355 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 109: -#line 361 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 110: -#line 367 "pars0grm.y" - { (yyval) = pars_update_statement_start(FALSE, - (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 111: -#line 373 "pars0grm.y" - { (yyval) = pars_update_statement((yyvsp[-1]), NULL, (yyvsp[0])); ;} - break; - - case 112: -#line 378 "pars0grm.y" - { (yyval) = pars_update_statement((yyvsp[-1]), (yyvsp[0]), NULL); ;} - break; - - case 113: -#line 383 "pars0grm.y" - { (yyval) = pars_update_statement_start(TRUE, - (yyvsp[0]), NULL); ;} - break; - - case 114: -#line 389 "pars0grm.y" - { (yyval) = pars_update_statement((yyvsp[-1]), NULL, (yyvsp[0])); ;} - break; - - case 115: -#line 394 "pars0grm.y" - { (yyval) = pars_update_statement((yyvsp[-1]), (yyvsp[0]), NULL); ;} - break; - - case 116: -#line 399 "pars0grm.y" - { (yyval) = pars_row_printf_statement((yyvsp[0])); ;} - break; - - case 117: -#line 404 "pars0grm.y" - { (yyval) = pars_assignment_statement((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 118: -#line 410 "pars0grm.y" - { (yyval) = pars_elsif_element((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 119: -#line 414 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 120: -#line 416 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-1]), (yyvsp[0])); ;} - break; - - case 121: -#line 420 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 122: -#line 422 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 123: -#line 423 "pars0grm.y" - { (yyval) = (yyvsp[0]); ;} - break; - - case 124: -#line 430 "pars0grm.y" - { (yyval) = pars_if_statement((yyvsp[-5]), (yyvsp[-3]), (yyvsp[-2])); ;} - break; - - case 125: -#line 436 "pars0grm.y" - { (yyval) = pars_while_statement((yyvsp[-4]), (yyvsp[-2])); ;} - break; - - case 126: -#line 444 "pars0grm.y" - { (yyval) = pars_for_statement((yyvsp[-8]), (yyvsp[-6]), (yyvsp[-4]), (yyvsp[-2])); ;} - break; - - case 127: -#line 448 "pars0grm.y" - { (yyval) = pars_exit_statement(); ;} - break; - - case 128: -#line 452 "pars0grm.y" - { (yyval) = pars_return_statement(); ;} - break; - - case 129: -#line 457 "pars0grm.y" - { (yyval) = pars_open_statement( - ROW_SEL_OPEN_CURSOR, (yyvsp[0])); ;} - break; - - case 130: -#line 463 "pars0grm.y" - { (yyval) = pars_open_statement( - ROW_SEL_CLOSE_CURSOR, (yyvsp[0])); ;} - break; - - case 131: -#line 469 "pars0grm.y" - { (yyval) = pars_fetch_statement((yyvsp[-2]), (yyvsp[0]), NULL); ;} - break; - - case 132: -#line 471 "pars0grm.y" - { (yyval) = pars_fetch_statement((yyvsp[-2]), NULL, (yyvsp[0])); ;} - break; - - case 133: -#line 476 "pars0grm.y" - { (yyval) = pars_column_def((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); ;} - break; - - case 134: -#line 480 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 135: -#line 482 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 136: -#line 486 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 137: -#line 488 "pars0grm.y" - { (yyval) = (yyvsp[-1]); ;} - break; - - case 138: -#line 492 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 139: -#line 494 "pars0grm.y" - { (yyval) = &pars_int_token; - /* pass any non-NULL pointer */ ;} - break; - - case 140: -#line 499 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 141: -#line 501 "pars0grm.y" - { (yyval) = &pars_int_token; - /* pass any non-NULL pointer */ ;} - break; - - case 142: -#line 506 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 143: -#line 508 "pars0grm.y" - { (yyval) = &pars_int_token; - /* pass any non-NULL pointer */ ;} - break; - - case 144: -#line 515 "pars0grm.y" - { (yyval) = pars_create_table((yyvsp[-4]), (yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 145: -#line 519 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 146: -#line 521 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 147: -#line 525 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 148: -#line 526 "pars0grm.y" - { (yyval) = &pars_unique_token; ;} - break; - - case 149: -#line 530 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 150: -#line 531 "pars0grm.y" - { (yyval) = &pars_clustered_token; ;} - break; - - case 151: -#line 539 "pars0grm.y" - { (yyval) = pars_create_index((yyvsp[-8]), (yyvsp[-7]), (yyvsp[-5]), (yyvsp[-3]), (yyvsp[-1])); ;} - break; - - case 152: -#line 544 "pars0grm.y" - { (yyval) = pars_commit_statement(); ;} - break; - - case 153: -#line 549 "pars0grm.y" - { (yyval) = pars_rollback_statement(); ;} - break; - - case 154: -#line 553 "pars0grm.y" - { (yyval) = &pars_int_token; ;} - break; - - case 155: -#line 554 "pars0grm.y" - { (yyval) = &pars_int_token; ;} - break; - - case 156: -#line 555 "pars0grm.y" - { (yyval) = &pars_char_token; ;} - break; - - case 157: -#line 556 "pars0grm.y" - { (yyval) = &pars_binary_token; ;} - break; - - case 158: -#line 557 "pars0grm.y" - { (yyval) = &pars_blob_token; ;} - break; - - case 159: -#line 562 "pars0grm.y" - { (yyval) = pars_parameter_declaration((yyvsp[-2]), - PARS_INPUT, (yyvsp[0])); ;} - break; - - case 160: -#line 565 "pars0grm.y" - { (yyval) = pars_parameter_declaration((yyvsp[-2]), - PARS_OUTPUT, (yyvsp[0])); ;} - break; - - case 161: -#line 570 "pars0grm.y" - { (yyval) = NULL; ;} - break; - - case 162: -#line 571 "pars0grm.y" - { (yyval) = que_node_list_add_last(NULL, (yyvsp[0])); ;} - break; - - case 163: -#line 573 "pars0grm.y" - { (yyval) = que_node_list_add_last((yyvsp[-2]), (yyvsp[0])); ;} - break; - - case 164: -#line 578 "pars0grm.y" - { (yyval) = pars_variable_declaration((yyvsp[-2]), (yyvsp[-1])); ;} - break; - - case 168: -#line 590 "pars0grm.y" - { (yyval) = pars_cursor_declaration((yyvsp[-3]), (yyvsp[-1])); ;} - break; - - case 169: -#line 595 "pars0grm.y" - { (yyval) = pars_function_declaration((yyvsp[-1])); ;} - break; - - case 175: -#line 616 "pars0grm.y" - { (yyval) = pars_procedure_definition((yyvsp[-9]), (yyvsp[-7]), - (yyvsp[-1])); ;} - break; - - - } - -/* Line 1010 of yacc.c. */ -#line 2345 "pars0grm.c" - - yyvsp -= yylen; - yyssp -= yylen; - - - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } - } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ - if (yychar == YYEOF) - for (;;) - { - - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp); - } - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) - goto yyerrorlab; -#endif - -yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval); - yychar = YYEMPTY; - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - return yyresult; -} - - -#line 620 "pars0grm.y" - - diff --git a/storage/innobase/pars/pars0grm.cc b/storage/innobase/pars/pars0grm.cc new file mode 100644 index 00000000000..b360f36e597 --- /dev/null +++ b/storage/innobase/pars/pars0grm.cc @@ -0,0 +1,3034 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + PARS_INT_LIT = 258, + PARS_FLOAT_LIT = 259, + PARS_STR_LIT = 260, + PARS_FIXBINARY_LIT = 261, + PARS_BLOB_LIT = 262, + PARS_NULL_LIT = 263, + PARS_ID_TOKEN = 264, + PARS_AND_TOKEN = 265, + PARS_OR_TOKEN = 266, + PARS_NOT_TOKEN = 267, + PARS_GE_TOKEN = 268, + PARS_LE_TOKEN = 269, + PARS_NE_TOKEN = 270, + PARS_PROCEDURE_TOKEN = 271, + PARS_IN_TOKEN = 272, + PARS_OUT_TOKEN = 273, + PARS_BINARY_TOKEN = 274, + PARS_BLOB_TOKEN = 275, + PARS_INT_TOKEN = 276, + PARS_INTEGER_TOKEN = 277, + PARS_FLOAT_TOKEN = 278, + PARS_CHAR_TOKEN = 279, + PARS_IS_TOKEN = 280, + PARS_BEGIN_TOKEN = 281, + PARS_END_TOKEN = 282, + PARS_IF_TOKEN = 283, + PARS_THEN_TOKEN = 284, + PARS_ELSE_TOKEN = 285, + PARS_ELSIF_TOKEN = 286, + PARS_LOOP_TOKEN = 287, + PARS_WHILE_TOKEN = 288, + PARS_RETURN_TOKEN = 289, + PARS_SELECT_TOKEN = 290, + PARS_SUM_TOKEN = 291, + PARS_COUNT_TOKEN = 292, + PARS_DISTINCT_TOKEN = 293, + PARS_FROM_TOKEN = 294, + PARS_WHERE_TOKEN = 295, + PARS_FOR_TOKEN = 296, + PARS_DDOT_TOKEN = 297, + PARS_READ_TOKEN = 298, + PARS_ORDER_TOKEN = 299, + PARS_BY_TOKEN = 300, + PARS_ASC_TOKEN = 301, + PARS_DESC_TOKEN = 302, + PARS_INSERT_TOKEN = 303, + PARS_INTO_TOKEN = 304, + PARS_VALUES_TOKEN = 305, + PARS_UPDATE_TOKEN = 306, + PARS_SET_TOKEN = 307, + PARS_DELETE_TOKEN = 308, + PARS_CURRENT_TOKEN = 309, + PARS_OF_TOKEN = 310, + PARS_CREATE_TOKEN = 311, + PARS_TABLE_TOKEN = 312, + PARS_INDEX_TOKEN = 313, + PARS_UNIQUE_TOKEN = 314, + PARS_CLUSTERED_TOKEN = 315, + PARS_DOES_NOT_FIT_IN_MEM_TOKEN = 316, + PARS_ON_TOKEN = 317, + PARS_ASSIGN_TOKEN = 318, + PARS_DECLARE_TOKEN = 319, + PARS_CURSOR_TOKEN = 320, + PARS_SQL_TOKEN = 321, + PARS_OPEN_TOKEN = 322, + PARS_FETCH_TOKEN = 323, + PARS_CLOSE_TOKEN = 324, + PARS_NOTFOUND_TOKEN = 325, + PARS_TO_CHAR_TOKEN = 326, + PARS_TO_NUMBER_TOKEN = 327, + PARS_TO_BINARY_TOKEN = 328, + PARS_BINARY_TO_NUMBER_TOKEN = 329, + PARS_SUBSTR_TOKEN = 330, + PARS_REPLSTR_TOKEN = 331, + PARS_CONCAT_TOKEN = 332, + PARS_INSTR_TOKEN = 333, + PARS_LENGTH_TOKEN = 334, + PARS_SYSDATE_TOKEN = 335, + PARS_PRINTF_TOKEN = 336, + PARS_ASSERT_TOKEN = 337, + PARS_RND_TOKEN = 338, + PARS_RND_STR_TOKEN = 339, + PARS_ROW_PRINTF_TOKEN = 340, + PARS_COMMIT_TOKEN = 341, + PARS_ROLLBACK_TOKEN = 342, + PARS_WORK_TOKEN = 343, + PARS_UNSIGNED_TOKEN = 344, + PARS_EXIT_TOKEN = 345, + PARS_FUNCTION_TOKEN = 346, + PARS_LOCK_TOKEN = 347, + PARS_SHARE_TOKEN = 348, + PARS_MODE_TOKEN = 349, + PARS_LIKE_TOKEN = 350, + PARS_LIKE_TOKEN_EXACT = 351, + PARS_LIKE_TOKEN_PREFIX = 352, + PARS_LIKE_TOKEN_SUFFIX = 353, + PARS_LIKE_TOKEN_SUBSTR = 354, + PARS_TABLE_NAME_TOKEN = 355, + PARS_COMPACT_TOKEN = 356, + PARS_BLOCK_SIZE_TOKEN = 357, + PARS_BIGINT_TOKEN = 358, + NEG = 359 + }; +#endif +/* Tokens. */ +#define PARS_INT_LIT 258 +#define PARS_FLOAT_LIT 259 +#define PARS_STR_LIT 260 +#define PARS_FIXBINARY_LIT 261 +#define PARS_BLOB_LIT 262 +#define PARS_NULL_LIT 263 +#define PARS_ID_TOKEN 264 +#define PARS_AND_TOKEN 265 +#define PARS_OR_TOKEN 266 +#define PARS_NOT_TOKEN 267 +#define PARS_GE_TOKEN 268 +#define PARS_LE_TOKEN 269 +#define PARS_NE_TOKEN 270 +#define PARS_PROCEDURE_TOKEN 271 +#define PARS_IN_TOKEN 272 +#define PARS_OUT_TOKEN 273 +#define PARS_BINARY_TOKEN 274 +#define PARS_BLOB_TOKEN 275 +#define PARS_INT_TOKEN 276 +#define PARS_INTEGER_TOKEN 277 +#define PARS_FLOAT_TOKEN 278 +#define PARS_CHAR_TOKEN 279 +#define PARS_IS_TOKEN 280 +#define PARS_BEGIN_TOKEN 281 +#define PARS_END_TOKEN 282 +#define PARS_IF_TOKEN 283 +#define PARS_THEN_TOKEN 284 +#define PARS_ELSE_TOKEN 285 +#define PARS_ELSIF_TOKEN 286 +#define PARS_LOOP_TOKEN 287 +#define PARS_WHILE_TOKEN 288 +#define PARS_RETURN_TOKEN 289 +#define PARS_SELECT_TOKEN 290 +#define PARS_SUM_TOKEN 291 +#define PARS_COUNT_TOKEN 292 +#define PARS_DISTINCT_TOKEN 293 +#define PARS_FROM_TOKEN 294 +#define PARS_WHERE_TOKEN 295 +#define PARS_FOR_TOKEN 296 +#define PARS_DDOT_TOKEN 297 +#define PARS_READ_TOKEN 298 +#define PARS_ORDER_TOKEN 299 +#define PARS_BY_TOKEN 300 +#define PARS_ASC_TOKEN 301 +#define PARS_DESC_TOKEN 302 +#define PARS_INSERT_TOKEN 303 +#define PARS_INTO_TOKEN 304 +#define PARS_VALUES_TOKEN 305 +#define PARS_UPDATE_TOKEN 306 +#define PARS_SET_TOKEN 307 +#define PARS_DELETE_TOKEN 308 +#define PARS_CURRENT_TOKEN 309 +#define PARS_OF_TOKEN 310 +#define PARS_CREATE_TOKEN 311 +#define PARS_TABLE_TOKEN 312 +#define PARS_INDEX_TOKEN 313 +#define PARS_UNIQUE_TOKEN 314 +#define PARS_CLUSTERED_TOKEN 315 +#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 316 +#define PARS_ON_TOKEN 317 +#define PARS_ASSIGN_TOKEN 318 +#define PARS_DECLARE_TOKEN 319 +#define PARS_CURSOR_TOKEN 320 +#define PARS_SQL_TOKEN 321 +#define PARS_OPEN_TOKEN 322 +#define PARS_FETCH_TOKEN 323 +#define PARS_CLOSE_TOKEN 324 +#define PARS_NOTFOUND_TOKEN 325 +#define PARS_TO_CHAR_TOKEN 326 +#define PARS_TO_NUMBER_TOKEN 327 +#define PARS_TO_BINARY_TOKEN 328 +#define PARS_BINARY_TO_NUMBER_TOKEN 329 +#define PARS_SUBSTR_TOKEN 330 +#define PARS_REPLSTR_TOKEN 331 +#define PARS_CONCAT_TOKEN 332 +#define PARS_INSTR_TOKEN 333 +#define PARS_LENGTH_TOKEN 334 +#define PARS_SYSDATE_TOKEN 335 +#define PARS_PRINTF_TOKEN 336 +#define PARS_ASSERT_TOKEN 337 +#define PARS_RND_TOKEN 338 +#define PARS_RND_STR_TOKEN 339 +#define PARS_ROW_PRINTF_TOKEN 340 +#define PARS_COMMIT_TOKEN 341 +#define PARS_ROLLBACK_TOKEN 342 +#define PARS_WORK_TOKEN 343 +#define PARS_UNSIGNED_TOKEN 344 +#define PARS_EXIT_TOKEN 345 +#define PARS_FUNCTION_TOKEN 346 +#define PARS_LOCK_TOKEN 347 +#define PARS_SHARE_TOKEN 348 +#define PARS_MODE_TOKEN 349 +#define PARS_LIKE_TOKEN 350 +#define PARS_LIKE_TOKEN_EXACT 351 +#define PARS_LIKE_TOKEN_PREFIX 352 +#define PARS_LIKE_TOKEN_SUFFIX 353 +#define PARS_LIKE_TOKEN_SUBSTR 354 +#define PARS_TABLE_NAME_TOKEN 355 +#define PARS_COMPACT_TOKEN 356 +#define PARS_BLOCK_SIZE_TOKEN 357 +#define PARS_BIGINT_TOKEN 358 +#define NEG 359 + + + + +/* Copy the first part of user declarations. */ +#line 28 "pars0grm.y" + +/* The value of the semantic attribute is a pointer to a query tree node +que_node_t */ + +#include "univ.i" +#include <math.h> /* Can't be before univ.i */ +#include "pars0pars.h" +#include "mem0mem.h" +#include "que0types.h" +#include "que0que.h" +#include "row0sel.h" + +#define YYSTYPE que_node_t* + +/* #define __STDC__ */ + +int +yylex(void); + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 334 "pars0grm.cc" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void*); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 5 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 816 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 120 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 73 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 183 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 350 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 359 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 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, 112, 2, 2, + 114, 115, 109, 108, 117, 107, 2, 110, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 113, + 105, 104, 106, 116, 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, 118, 2, 119, 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, 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, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 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, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 111 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 14, 17, 20, 23, + 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, + 56, 59, 62, 65, 68, 71, 73, 76, 78, 83, + 85, 87, 89, 91, 93, 95, 97, 101, 105, 109, + 113, 116, 120, 124, 128, 132, 136, 140, 144, 148, + 152, 156, 159, 163, 167, 169, 171, 173, 175, 177, + 179, 181, 183, 185, 187, 189, 190, 192, 196, 203, + 208, 210, 212, 214, 218, 220, 224, 225, 227, 231, + 232, 234, 238, 240, 245, 251, 256, 257, 259, 263, + 265, 269, 271, 272, 275, 276, 279, 280, 285, 286, + 288, 290, 291, 296, 305, 309, 315, 318, 322, 324, + 328, 333, 338, 341, 344, 348, 351, 354, 357, 361, + 366, 368, 371, 372, 375, 377, 385, 392, 403, 405, + 407, 410, 413, 418, 423, 429, 431, 435, 436, 440, + 441, 443, 444, 447, 448, 450, 451, 453, 454, 458, + 468, 470, 474, 475, 477, 478, 480, 491, 493, 495, + 498, 501, 503, 505, 507, 509, 511, 513, 517, 521, + 522, 524, 528, 532, 533, 535, 538, 545, 550, 552, + 554, 555, 557, 560 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 121, 0, -1, 192, 113, -1, 127, -1, 128, 113, + -1, 160, 113, -1, 161, 113, -1, 162, 113, -1, + 159, 113, -1, 163, 113, -1, 155, 113, -1, 142, + 113, -1, 144, 113, -1, 154, 113, -1, 152, 113, + -1, 153, 113, -1, 149, 113, -1, 150, 113, -1, + 164, 113, -1, 166, 113, -1, 165, 113, -1, 181, + 113, -1, 182, 113, -1, 175, 113, -1, 179, 113, + -1, 122, -1, 123, 122, -1, 9, -1, 125, 114, + 133, 115, -1, 3, -1, 4, -1, 5, -1, 6, + -1, 7, -1, 8, -1, 66, -1, 124, 108, 124, + -1, 124, 107, 124, -1, 124, 109, 124, -1, 124, + 110, 124, -1, 107, 124, -1, 114, 124, 115, -1, + 124, 104, 124, -1, 124, 95, 5, -1, 124, 105, + 124, -1, 124, 106, 124, -1, 124, 13, 124, -1, + 124, 14, 124, -1, 124, 15, 124, -1, 124, 10, + 124, -1, 124, 11, 124, -1, 12, 124, -1, 9, + 112, 70, -1, 66, 112, 70, -1, 71, -1, 72, + -1, 73, -1, 74, -1, 75, -1, 77, -1, 78, + -1, 79, -1, 80, -1, 83, -1, 84, -1, -1, + 116, -1, 126, 117, 116, -1, 118, 9, 114, 126, + 115, 119, -1, 129, 114, 133, 115, -1, 76, -1, + 81, -1, 82, -1, 9, 114, 115, -1, 180, -1, + 131, 117, 180, -1, -1, 9, -1, 132, 117, 9, + -1, -1, 124, -1, 133, 117, 124, -1, 124, -1, + 37, 114, 109, 115, -1, 37, 114, 38, 9, 115, + -1, 36, 114, 124, 115, -1, -1, 134, -1, 135, + 117, 134, -1, 109, -1, 135, 49, 132, -1, 135, + -1, -1, 40, 124, -1, -1, 41, 51, -1, -1, + 92, 17, 93, 94, -1, -1, 46, -1, 47, -1, + -1, 44, 45, 9, 140, -1, 35, 136, 39, 131, + 137, 138, 139, 141, -1, 48, 49, 180, -1, 143, + 50, 114, 133, 115, -1, 143, 142, -1, 9, 104, + 124, -1, 145, -1, 146, 117, 145, -1, 40, 54, + 55, 9, -1, 51, 180, 52, 146, -1, 148, 137, + -1, 148, 147, -1, 53, 39, 180, -1, 151, 137, + -1, 151, 147, -1, 85, 142, -1, 9, 63, 124, + -1, 31, 124, 29, 123, -1, 156, -1, 157, 156, + -1, -1, 30, 123, -1, 157, -1, 28, 124, 29, + 123, 158, 27, 28, -1, 33, 124, 32, 123, 27, + 32, -1, 41, 9, 17, 124, 42, 124, 32, 123, + 27, 32, -1, 90, -1, 34, -1, 67, 9, -1, + 69, 9, -1, 68, 9, 49, 132, -1, 68, 9, + 49, 130, -1, 9, 183, 169, 170, 171, -1, 167, + -1, 168, 117, 167, -1, -1, 114, 3, 115, -1, + -1, 89, -1, -1, 12, 8, -1, -1, 61, -1, + -1, 101, -1, -1, 102, 104, 3, -1, 56, 57, + 180, 114, 168, 115, 172, 173, 174, -1, 9, -1, + 176, 117, 9, -1, -1, 59, -1, -1, 60, -1, + 56, 177, 178, 58, 9, 62, 180, 114, 176, 115, + -1, 9, -1, 100, -1, 86, 88, -1, 87, 88, + -1, 21, -1, 22, -1, 103, -1, 24, -1, 19, + -1, 20, -1, 9, 17, 183, -1, 9, 18, 183, + -1, -1, 184, -1, 185, 117, 184, -1, 9, 183, + 113, -1, -1, 186, -1, 187, 186, -1, 64, 65, + 9, 25, 142, 113, -1, 64, 91, 9, 113, -1, + 188, -1, 189, -1, -1, 190, -1, 191, 190, -1, + 16, 9, 114, 185, 115, 25, 187, 191, 26, 123, + 27, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 162, 162, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 190, 191, 196, 197, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 225, 230, 231, 232, 233, 235, 236, + 237, 238, 239, 240, 241, 244, 246, 247, 251, 257, + 262, 263, 264, 268, 272, 273, 278, 279, 280, 285, + 286, 287, 291, 292, 297, 303, 310, 311, 312, 317, + 319, 322, 326, 327, 331, 332, 337, 338, 343, 344, + 345, 349, 350, 357, 372, 377, 380, 388, 394, 395, + 400, 406, 415, 423, 431, 438, 446, 454, 460, 467, + 473, 474, 479, 480, 482, 486, 493, 499, 509, 513, + 517, 524, 531, 535, 543, 552, 553, 558, 559, 564, + 565, 571, 572, 578, 579, 585, 586, 591, 592, 597, + 608, 609, 614, 615, 619, 620, 624, 638, 639, 643, + 648, 653, 654, 655, 656, 657, 658, 662, 667, 675, + 676, 677, 682, 688, 690, 691, 695, 703, 709, 710, + 713, 715, 716, 720 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "PARS_INT_LIT", "PARS_FLOAT_LIT", + "PARS_STR_LIT", "PARS_FIXBINARY_LIT", "PARS_BLOB_LIT", "PARS_NULL_LIT", + "PARS_ID_TOKEN", "PARS_AND_TOKEN", "PARS_OR_TOKEN", "PARS_NOT_TOKEN", + "PARS_GE_TOKEN", "PARS_LE_TOKEN", "PARS_NE_TOKEN", + "PARS_PROCEDURE_TOKEN", "PARS_IN_TOKEN", "PARS_OUT_TOKEN", + "PARS_BINARY_TOKEN", "PARS_BLOB_TOKEN", "PARS_INT_TOKEN", + "PARS_INTEGER_TOKEN", "PARS_FLOAT_TOKEN", "PARS_CHAR_TOKEN", + "PARS_IS_TOKEN", "PARS_BEGIN_TOKEN", "PARS_END_TOKEN", "PARS_IF_TOKEN", + "PARS_THEN_TOKEN", "PARS_ELSE_TOKEN", "PARS_ELSIF_TOKEN", + "PARS_LOOP_TOKEN", "PARS_WHILE_TOKEN", "PARS_RETURN_TOKEN", + "PARS_SELECT_TOKEN", "PARS_SUM_TOKEN", "PARS_COUNT_TOKEN", + "PARS_DISTINCT_TOKEN", "PARS_FROM_TOKEN", "PARS_WHERE_TOKEN", + "PARS_FOR_TOKEN", "PARS_DDOT_TOKEN", "PARS_READ_TOKEN", + "PARS_ORDER_TOKEN", "PARS_BY_TOKEN", "PARS_ASC_TOKEN", "PARS_DESC_TOKEN", + "PARS_INSERT_TOKEN", "PARS_INTO_TOKEN", "PARS_VALUES_TOKEN", + "PARS_UPDATE_TOKEN", "PARS_SET_TOKEN", "PARS_DELETE_TOKEN", + "PARS_CURRENT_TOKEN", "PARS_OF_TOKEN", "PARS_CREATE_TOKEN", + "PARS_TABLE_TOKEN", "PARS_INDEX_TOKEN", "PARS_UNIQUE_TOKEN", + "PARS_CLUSTERED_TOKEN", "PARS_DOES_NOT_FIT_IN_MEM_TOKEN", + "PARS_ON_TOKEN", "PARS_ASSIGN_TOKEN", "PARS_DECLARE_TOKEN", + "PARS_CURSOR_TOKEN", "PARS_SQL_TOKEN", "PARS_OPEN_TOKEN", + "PARS_FETCH_TOKEN", "PARS_CLOSE_TOKEN", "PARS_NOTFOUND_TOKEN", + "PARS_TO_CHAR_TOKEN", "PARS_TO_NUMBER_TOKEN", "PARS_TO_BINARY_TOKEN", + "PARS_BINARY_TO_NUMBER_TOKEN", "PARS_SUBSTR_TOKEN", "PARS_REPLSTR_TOKEN", + "PARS_CONCAT_TOKEN", "PARS_INSTR_TOKEN", "PARS_LENGTH_TOKEN", + "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", "PARS_FUNCTION_TOKEN", + "PARS_LOCK_TOKEN", "PARS_SHARE_TOKEN", "PARS_MODE_TOKEN", + "PARS_LIKE_TOKEN", "PARS_LIKE_TOKEN_EXACT", "PARS_LIKE_TOKEN_PREFIX", + "PARS_LIKE_TOKEN_SUFFIX", "PARS_LIKE_TOKEN_SUBSTR", + "PARS_TABLE_NAME_TOKEN", "PARS_COMPACT_TOKEN", "PARS_BLOCK_SIZE_TOKEN", + "PARS_BIGINT_TOKEN", "'='", "'<'", "'>'", "'-'", "'+'", "'*'", "'/'", + "NEG", "'%'", "';'", "'('", "')'", "'?'", "','", "'{'", "'}'", "$accept", + "top_statement", "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", "lock_shared_clause", "order_direction", + "order_by_clause", "select_statement", "insert_statement_start", + "insert_statement", "column_assignment", "column_assignment_list", + "cursor_positioned", "update_statement_start", + "update_statement_searched", "update_statement_positioned", + "delete_statement_start", "delete_statement_searched", + "delete_statement_positioned", "row_printf_statement", + "assignment_statement", "elsif_element", "elsif_list", "else_part", + "if_statement", "while_statement", "for_statement", "exit_statement", + "return_statement", "open_cursor_statement", "close_cursor_statement", + "fetch_statement", "column_def", "column_def_list", "opt_column_len", + "opt_unsigned", "opt_not_null", "not_fit_in_memory", "compact", + "block_size", "create_table", "column_list", "unique_def", + "clustered_def", "create_index", "table_name", "commit_statement", + "rollback_statement", "type_name", "parameter_declaration", + "parameter_declaration_list", "variable_declaration", + "variable_declaration_list", "cursor_declaration", + "function_declaration", "declaration", "declaration_list", + "procedure_definition", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 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, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 61, 60, 62, 45, 43, 42, + 47, 359, 37, 59, 40, 41, 63, 44, 123, 125 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 120, 121, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 123, 123, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 126, 126, 126, 127, 128, + 129, 129, 129, 130, 131, 131, 132, 132, 132, 133, + 133, 133, 134, 134, 134, 134, 135, 135, 135, 136, + 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, + 140, 141, 141, 142, 143, 144, 144, 145, 146, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 157, 158, 158, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 166, 167, 168, 168, 169, 169, 170, + 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, + 176, 176, 177, 177, 178, 178, 179, 180, 180, 181, + 182, 183, 183, 183, 183, 183, 183, 184, 184, 185, + 185, 185, 186, 187, 187, 187, 188, 189, 190, 190, + 191, 191, 191, 192 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 1, 4, 1, + 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, + 2, 3, 3, 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, 3, 1, 3, 0, 1, 3, 0, + 1, 3, 1, 4, 5, 4, 0, 1, 3, 1, + 3, 1, 0, 2, 0, 2, 0, 4, 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, 0, 1, 0, 3, 9, + 1, 3, 0, 1, 0, 1, 10, 1, 1, 2, + 2, 1, 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 + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 0, 0, 0, 1, 2, 169, 0, 170, + 0, 0, 0, 0, 0, 165, 166, 161, 162, 164, + 163, 167, 168, 173, 171, 0, 174, 180, 0, 0, + 175, 178, 179, 181, 0, 172, 0, 0, 0, 182, + 0, 0, 0, 0, 0, 129, 86, 0, 0, 0, + 0, 152, 0, 0, 0, 70, 71, 72, 0, 0, + 0, 128, 0, 25, 0, 3, 0, 0, 0, 0, + 0, 92, 0, 0, 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 177, 0, 29, 30, 31, 32, 33, 34, + 27, 0, 35, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 0, 0, 0, 0, 0, 0, + 0, 89, 82, 87, 91, 0, 0, 0, 157, 158, + 0, 0, 0, 153, 154, 130, 0, 131, 117, 159, + 160, 0, 183, 26, 4, 79, 11, 0, 106, 12, + 0, 112, 113, 16, 17, 115, 116, 14, 15, 13, + 10, 8, 5, 6, 7, 9, 18, 20, 19, 23, + 24, 21, 22, 0, 118, 0, 51, 0, 40, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 79, 0, 0, 0, 76, 0, + 0, 0, 104, 0, 114, 0, 155, 0, 76, 65, + 80, 0, 79, 0, 93, 176, 52, 53, 41, 49, + 50, 46, 47, 48, 122, 43, 42, 44, 45, 37, + 36, 38, 39, 0, 0, 0, 0, 0, 77, 90, + 88, 92, 74, 0, 0, 108, 111, 0, 0, 77, + 133, 132, 66, 0, 69, 0, 0, 0, 0, 0, + 120, 124, 0, 28, 0, 85, 0, 83, 0, 0, + 0, 94, 0, 0, 0, 0, 135, 0, 0, 0, + 0, 0, 81, 105, 110, 123, 0, 121, 0, 126, + 84, 78, 75, 0, 96, 0, 107, 109, 137, 143, + 0, 0, 73, 68, 67, 0, 125, 95, 0, 101, + 0, 0, 139, 144, 145, 136, 0, 119, 0, 0, + 103, 0, 0, 140, 141, 146, 147, 0, 0, 0, + 0, 138, 0, 134, 0, 149, 150, 0, 97, 98, + 127, 142, 0, 156, 0, 99, 100, 102, 148, 151 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 2, 63, 64, 210, 117, 253, 65, 66, 67, + 250, 241, 239, 211, 123, 124, 125, 151, 294, 309, + 347, 320, 68, 69, 70, 245, 246, 152, 71, 72, + 73, 74, 75, 76, 77, 78, 260, 261, 262, 79, + 80, 81, 82, 83, 84, 85, 86, 276, 277, 312, + 324, 333, 314, 326, 335, 87, 337, 134, 207, 88, + 130, 89, 90, 21, 9, 10, 26, 27, 31, 32, + 33, 34, 3 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -179 +static const yytype_int16 yypact[] = +{ + 24, 36, 58, -48, -25, -179, -179, 57, 31, -179, + -74, 14, 14, 50, 57, -179, -179, -179, -179, -179, + -179, -179, -179, 72, -179, 14, -179, 3, -26, -28, + -179, -179, -179, -179, 4, -179, 91, 95, 589, -179, + 80, -6, 43, 285, 285, -179, 19, 99, 69, -5, + 81, -13, 110, 112, 114, -179, -179, -179, 89, 37, + 41, -179, 122, -179, 406, -179, 25, 40, 44, -3, + 46, 116, 49, 51, 116, 52, 53, 54, 55, 56, + 59, 61, 62, 70, 73, 74, 75, 76, 77, 78, + 79, 89, -179, 285, -179, -179, -179, -179, -179, -179, + 82, 285, 83, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, 285, 285, 577, 92, 618, 94, + 97, -179, 706, -179, -33, 124, 153, -5, -179, -179, + 141, -5, -5, -179, 136, -179, 148, -179, -179, -179, + -179, 98, -179, -179, -179, 285, -179, 101, -179, -179, + 195, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, 100, 706, 135, 6, 154, -7, 206, + 285, 285, 285, 285, 285, 589, 218, 285, 285, 285, + 285, 285, 285, 285, 285, 589, 285, -27, 216, 173, + -5, 285, -179, 217, -179, 113, -179, 171, 221, 119, + 706, -56, 285, 185, 706, -179, -179, -179, -179, 6, + 6, 27, 27, 706, 345, -179, 27, 27, 27, 35, + 35, -7, -7, -53, 467, 223, 232, 127, -179, 126, + -179, -31, -179, 638, 151, -179, 142, 251, 253, 150, + -179, 126, -179, -46, -179, 285, -45, 256, 589, 285, + -179, 240, 249, -179, 245, -179, 166, -179, 273, 285, + -5, 242, 285, 285, 217, 14, -179, -39, 222, 170, + 167, 179, 706, -179, -179, 589, 679, -179, 268, -179, + -179, -179, -179, 247, 207, 686, 706, -179, 186, 243, + 251, -5, -179, -179, -179, 589, -179, -179, 286, 261, + 589, 303, 219, -179, 224, -179, 193, 589, 226, 272, + -179, 528, 205, -179, 310, -179, 233, 314, 230, 317, + 302, -179, 328, -179, 235, -179, -179, -38, -179, 7, + -179, -179, 334, -179, 331, -179, -179, -179, -179, -179 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -179, -179, -63, -178, -41, -179, -179, -179, -179, -179, + -179, -179, 133, -155, 143, -179, -179, -68, -179, -179, + -179, -179, -40, -179, -179, 71, -179, 269, -179, -179, + -179, -179, -179, -179, -179, -179, 85, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, 47, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -117, -179, -179, -12, 330, -179, 321, -179, -179, -179, + 315, -179, -179 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint16 yytable[] = +{ + 22, 143, 116, 118, 128, 122, 155, 224, 184, 269, + 202, 236, 25, 28, 204, 205, 198, 234, 138, 182, + 183, 184, 94, 95, 96, 97, 98, 99, 100, 148, + 38, 101, 46, 15, 16, 17, 18, 36, 19, 233, + 1, 13, 184, 14, 132, 4, 133, 147, 11, 12, + 184, 173, 174, 345, 346, 119, 120, 256, 5, 254, + 176, 255, 263, 37, 255, 6, 8, 29, 29, 280, + 283, 281, 255, 178, 179, 23, 299, 343, 300, 344, + 285, 25, 237, 242, 199, 102, 270, 35, 186, 7, + 103, 104, 105, 106, 107, 129, 108, 109, 110, 111, + 40, 186, 112, 113, 41, 91, 93, 92, 126, 214, + 187, 188, 189, 190, 191, 192, 193, 20, 127, 135, + 131, 136, 186, 137, 46, 139, 114, 317, 121, 140, + 186, 141, 321, 115, 190, 191, 192, 193, 144, 219, + 220, 221, 222, 223, 192, 193, 226, 227, 228, 229, + 230, 231, 232, 292, 145, 235, 150, 146, 122, 149, + 243, 143, 153, 200, 154, 157, 158, 159, 160, 161, + 201, 143, 162, 271, 163, 164, 94, 95, 96, 97, + 98, 99, 100, 165, 316, 101, 166, 167, 168, 169, + 170, 171, 172, 203, 175, 177, 206, 208, 94, 95, + 96, 97, 98, 99, 100, 216, 194, 101, 196, 119, + 120, 197, 209, 215, 282, 212, 180, 181, 286, 182, + 183, 184, 143, 225, 217, 238, 244, 247, 214, 248, + 249, 295, 296, 180, 181, 252, 182, 183, 184, 102, + 257, 266, 267, 268, 103, 104, 105, 106, 107, 213, + 108, 109, 110, 111, 143, 273, 112, 113, 143, 274, + 275, 102, 278, 298, 279, 284, 103, 104, 105, 106, + 107, 259, 108, 109, 110, 111, 288, 289, 112, 113, + 114, 290, 291, 293, 301, 302, 303, 115, 94, 95, + 96, 97, 98, 99, 100, 304, 306, 101, 307, 308, + 311, 186, 114, 318, 313, 319, 322, 327, 323, 115, + 187, 188, 189, 190, 191, 192, 193, 329, 186, 328, + 331, 218, 332, 336, 338, 325, 339, 187, 188, 189, + 190, 191, 192, 193, 340, 334, 341, 348, 265, 342, + 349, 251, 240, 156, 24, 297, 287, 315, 30, 39, + 0, 102, 0, 0, 42, 0, 103, 104, 105, 106, + 107, 0, 108, 109, 110, 111, 0, 0, 112, 113, + 0, 0, 0, 43, 0, 258, 259, 0, 44, 45, + 46, 0, 0, 0, 0, 0, 47, 0, 0, 0, + 0, 0, 114, 48, 0, 0, 49, 0, 50, 115, + 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 53, 54, 42, 0, 0, 0, 0, + 0, 55, 0, 0, 0, 0, 56, 57, 0, 0, + 58, 59, 60, 142, 43, 61, 0, 0, 0, 44, + 45, 46, 0, 0, 0, 0, 0, 47, 0, 0, + 0, 0, 0, 0, 48, 0, 0, 49, 0, 50, + 0, 0, 51, 62, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 52, 53, 54, 42, 0, 0, 0, + 0, 0, 55, 0, 0, 0, 0, 56, 57, 0, + 0, 58, 59, 60, 264, 43, 61, 0, 0, 0, + 44, 45, 46, 0, 0, 0, 0, 0, 47, 0, + 0, 0, 0, 0, 0, 48, 0, 0, 49, 0, + 50, 0, 0, 51, 62, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 53, 54, 42, 0, 0, + 0, 0, 0, 55, 0, 0, 0, 0, 56, 57, + 0, 0, 58, 59, 60, 330, 43, 61, 0, 0, + 0, 44, 45, 46, 0, 0, 0, 0, 0, 47, + 0, 0, 0, 0, 0, 0, 48, 0, 0, 49, + 0, 50, 0, 0, 51, 62, 0, 180, 181, 0, + 182, 183, 184, 0, 0, 52, 53, 54, 42, 0, + 0, 0, 0, 0, 55, 0, 185, 0, 0, 56, + 57, 0, 0, 58, 59, 60, 0, 43, 61, 0, + 0, 0, 44, 45, 46, 0, 0, 0, 180, 181, + 47, 182, 183, 184, 0, 0, 0, 48, 0, 0, + 49, 0, 50, 0, 0, 51, 62, 0, 180, 181, + 195, 182, 183, 184, 0, 0, 52, 53, 54, 0, + 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, + 56, 57, 186, 0, 58, 59, 60, 0, 0, 61, + 272, 187, 188, 189, 190, 191, 192, 193, 0, 180, + 181, 0, 182, 183, 184, 0, 180, 181, 0, 182, + 183, 184, 0, 0, 0, 0, 0, 62, 305, 0, + 0, 0, 0, 186, 0, 0, 180, 181, 310, 182, + 183, 184, 187, 188, 189, 190, 191, 192, 193, 0, + 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, + 0, 0, 187, 188, 189, 190, 191, 192, 193, 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, 186, 0, 0, 0, 0, 0, + 0, 186, 0, 187, 188, 189, 190, 191, 192, 193, + 187, 188, 189, 190, 191, 192, 193, 0, 0, 0, + 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, + 187, 188, 189, 190, 191, 192, 193 +}; + +static const yytype_int16 yycheck[] = +{ + 12, 64, 43, 44, 9, 46, 74, 185, 15, 40, + 127, 38, 9, 25, 131, 132, 49, 195, 58, 13, + 14, 15, 3, 4, 5, 6, 7, 8, 9, 69, + 26, 12, 35, 19, 20, 21, 22, 65, 24, 194, + 16, 115, 15, 117, 57, 9, 59, 50, 17, 18, + 15, 91, 93, 46, 47, 36, 37, 212, 0, 115, + 101, 117, 115, 91, 117, 113, 9, 64, 64, 115, + 115, 117, 117, 114, 115, 25, 115, 115, 117, 117, + 258, 9, 109, 200, 117, 66, 117, 113, 95, 114, + 71, 72, 73, 74, 75, 100, 77, 78, 79, 80, + 9, 95, 83, 84, 9, 25, 63, 113, 9, 150, + 104, 105, 106, 107, 108, 109, 110, 103, 49, 9, + 39, 9, 95, 9, 35, 88, 107, 305, 109, 88, + 95, 9, 310, 114, 107, 108, 109, 110, 113, 180, + 181, 182, 183, 184, 109, 110, 187, 188, 189, 190, + 191, 192, 193, 270, 114, 196, 40, 113, 199, 113, + 201, 224, 113, 39, 113, 113, 113, 113, 113, 113, + 17, 234, 113, 241, 113, 113, 3, 4, 5, 6, + 7, 8, 9, 113, 301, 12, 113, 113, 113, 113, + 113, 113, 113, 52, 112, 112, 60, 49, 3, 4, + 5, 6, 7, 8, 9, 70, 114, 12, 114, 36, + 37, 114, 114, 113, 255, 114, 10, 11, 259, 13, + 14, 15, 285, 5, 70, 9, 9, 114, 269, 58, + 9, 272, 273, 10, 11, 116, 13, 14, 15, 66, + 55, 9, 115, 117, 71, 72, 73, 74, 75, 54, + 77, 78, 79, 80, 317, 104, 83, 84, 321, 117, + 9, 66, 9, 275, 114, 9, 71, 72, 73, 74, + 75, 31, 77, 78, 79, 80, 27, 32, 83, 84, + 107, 115, 9, 41, 62, 115, 119, 114, 3, 4, + 5, 6, 7, 8, 9, 116, 28, 12, 51, 92, + 114, 95, 107, 17, 61, 44, 3, 114, 89, 114, + 104, 105, 106, 107, 108, 109, 110, 45, 95, 93, + 115, 115, 12, 9, 94, 101, 9, 104, 105, 106, + 107, 108, 109, 110, 32, 102, 8, 3, 115, 104, + 9, 208, 199, 74, 14, 274, 261, 300, 27, 34, + -1, 66, -1, -1, 9, -1, 71, 72, 73, 74, + 75, -1, 77, 78, 79, 80, -1, -1, 83, 84, + -1, -1, -1, 28, -1, 30, 31, -1, 33, 34, + 35, -1, -1, -1, -1, -1, 41, -1, -1, -1, + -1, -1, 107, 48, -1, -1, 51, -1, 53, 114, + -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 67, 68, 69, 9, -1, -1, -1, -1, + -1, 76, -1, -1, -1, -1, 81, 82, -1, -1, + 85, 86, 87, 27, 28, 90, -1, -1, -1, 33, + 34, 35, -1, -1, -1, -1, -1, 41, -1, -1, + -1, -1, -1, -1, 48, -1, -1, 51, -1, 53, + -1, -1, 56, 118, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, 68, 69, 9, -1, -1, -1, + -1, -1, 76, -1, -1, -1, -1, 81, 82, -1, + -1, 85, 86, 87, 27, 28, 90, -1, -1, -1, + 33, 34, 35, -1, -1, -1, -1, -1, 41, -1, + -1, -1, -1, -1, -1, 48, -1, -1, 51, -1, + 53, -1, -1, 56, 118, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 67, 68, 69, 9, -1, -1, + -1, -1, -1, 76, -1, -1, -1, -1, 81, 82, + -1, -1, 85, 86, 87, 27, 28, 90, -1, -1, + -1, 33, 34, 35, -1, -1, -1, -1, -1, 41, + -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, + -1, 53, -1, -1, 56, 118, -1, 10, 11, -1, + 13, 14, 15, -1, -1, 67, 68, 69, 9, -1, + -1, -1, -1, -1, 76, -1, 29, -1, -1, 81, + 82, -1, -1, 85, 86, 87, -1, 28, 90, -1, + -1, -1, 33, 34, 35, -1, -1, -1, 10, 11, + 41, 13, 14, 15, -1, -1, -1, 48, -1, -1, + 51, -1, 53, -1, -1, 56, 118, -1, 10, 11, + 32, 13, 14, 15, -1, -1, 67, 68, 69, -1, + -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, + 81, 82, 95, -1, 85, 86, 87, -1, -1, 90, + 42, 104, 105, 106, 107, 108, 109, 110, -1, 10, + 11, -1, 13, 14, 15, -1, 10, 11, -1, 13, + 14, 15, -1, -1, -1, -1, -1, 118, 29, -1, + -1, -1, -1, 95, -1, -1, 10, 11, 32, 13, + 14, 15, 104, 105, 106, 107, 108, 109, 110, -1, + -1, -1, -1, 95, -1, -1, -1, -1, -1, -1, + -1, -1, 104, 105, 106, 107, 108, 109, 110, -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, 95, -1, -1, -1, -1, -1, + -1, 95, -1, 104, 105, 106, 107, 108, 109, 110, + 104, 105, 106, 107, 108, 109, 110, -1, -1, -1, + -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, + 104, 105, 106, 107, 108, 109, 110 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 16, 121, 192, 9, 0, 113, 114, 9, 184, + 185, 17, 18, 115, 117, 19, 20, 21, 22, 24, + 103, 183, 183, 25, 184, 9, 186, 187, 183, 64, + 186, 188, 189, 190, 191, 113, 65, 91, 26, 190, + 9, 9, 9, 28, 33, 34, 35, 41, 48, 51, + 53, 56, 67, 68, 69, 76, 81, 82, 85, 86, + 87, 90, 118, 122, 123, 127, 128, 129, 142, 143, + 144, 148, 149, 150, 151, 152, 153, 154, 155, 159, + 160, 161, 162, 163, 164, 165, 166, 175, 179, 181, + 182, 25, 113, 63, 3, 4, 5, 6, 7, 8, + 9, 12, 66, 71, 72, 73, 74, 75, 77, 78, + 79, 80, 83, 84, 107, 114, 124, 125, 124, 36, + 37, 109, 124, 134, 135, 136, 9, 49, 9, 100, + 180, 39, 57, 59, 177, 9, 9, 9, 142, 88, + 88, 9, 27, 122, 113, 114, 113, 50, 142, 113, + 40, 137, 147, 113, 113, 137, 147, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 142, 124, 112, 124, 112, 124, 124, + 10, 11, 13, 14, 15, 29, 95, 104, 105, 106, + 107, 108, 109, 110, 114, 32, 114, 114, 49, 117, + 39, 17, 180, 52, 180, 180, 60, 178, 49, 114, + 124, 133, 114, 54, 124, 113, 70, 70, 115, 124, + 124, 124, 124, 124, 123, 5, 124, 124, 124, 124, + 124, 124, 124, 133, 123, 124, 38, 109, 9, 132, + 134, 131, 180, 124, 9, 145, 146, 114, 58, 9, + 130, 132, 116, 126, 115, 117, 133, 55, 30, 31, + 156, 157, 158, 115, 27, 115, 9, 115, 117, 40, + 117, 137, 42, 104, 117, 9, 167, 168, 9, 114, + 115, 117, 124, 115, 9, 123, 124, 156, 27, 32, + 115, 9, 180, 41, 138, 124, 124, 145, 183, 115, + 117, 62, 115, 119, 116, 29, 28, 51, 92, 139, + 32, 114, 169, 61, 172, 167, 180, 123, 17, 44, + 141, 123, 3, 89, 170, 101, 173, 114, 93, 45, + 27, 115, 12, 171, 102, 174, 9, 176, 94, 9, + 32, 8, 104, 115, 117, 46, 47, 140, 3, 9 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 25: +#line 190 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 26: +#line 192 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); ;} + break; + + case 27: +#line 196 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 28: +#line 198 "pars0grm.y" + { (yyval) = pars_func((yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); ;} + break; + + case 29: +#line 199 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 30: +#line 200 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 31: +#line 201 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 32: +#line 202 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 33: +#line 203 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 34: +#line 204 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 35: +#line 205 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]);;} + break; + + case 36: +#line 206 "pars0grm.y" + { (yyval) = pars_op('+', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 37: +#line 207 "pars0grm.y" + { (yyval) = pars_op('-', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 38: +#line 208 "pars0grm.y" + { (yyval) = pars_op('*', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 39: +#line 209 "pars0grm.y" + { (yyval) = pars_op('/', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 40: +#line 210 "pars0grm.y" + { (yyval) = pars_op('-', (yyvsp[(2) - (2)]), NULL); ;} + break; + + case 41: +#line 211 "pars0grm.y" + { (yyval) = (yyvsp[(2) - (3)]); ;} + break; + + case 42: +#line 212 "pars0grm.y" + { (yyval) = pars_op('=', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 43: +#line 214 "pars0grm.y" + { (yyval) = pars_op(PARS_LIKE_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 44: +#line 215 "pars0grm.y" + { (yyval) = pars_op('<', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 45: +#line 216 "pars0grm.y" + { (yyval) = pars_op('>', (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 46: +#line 217 "pars0grm.y" + { (yyval) = pars_op(PARS_GE_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 47: +#line 218 "pars0grm.y" + { (yyval) = pars_op(PARS_LE_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 48: +#line 219 "pars0grm.y" + { (yyval) = pars_op(PARS_NE_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 49: +#line 220 "pars0grm.y" + { (yyval) = pars_op(PARS_AND_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 50: +#line 221 "pars0grm.y" + { (yyval) = pars_op(PARS_OR_TOKEN, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 51: +#line 222 "pars0grm.y" + { (yyval) = pars_op(PARS_NOT_TOKEN, (yyvsp[(2) - (2)]), NULL); ;} + break; + + case 52: +#line 224 "pars0grm.y" + { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[(1) - (3)]), NULL); ;} + break; + + case 53: +#line 226 "pars0grm.y" + { (yyval) = pars_op(PARS_NOTFOUND_TOKEN, (yyvsp[(1) - (3)]), NULL); ;} + break; + + case 54: +#line 230 "pars0grm.y" + { (yyval) = &pars_to_char_token; ;} + break; + + case 55: +#line 231 "pars0grm.y" + { (yyval) = &pars_to_number_token; ;} + break; + + case 56: +#line 232 "pars0grm.y" + { (yyval) = &pars_to_binary_token; ;} + break; + + case 57: +#line 234 "pars0grm.y" + { (yyval) = &pars_binary_to_number_token; ;} + break; + + case 58: +#line 235 "pars0grm.y" + { (yyval) = &pars_substr_token; ;} + break; + + case 59: +#line 236 "pars0grm.y" + { (yyval) = &pars_concat_token; ;} + break; + + case 60: +#line 237 "pars0grm.y" + { (yyval) = &pars_instr_token; ;} + break; + + case 61: +#line 238 "pars0grm.y" + { (yyval) = &pars_length_token; ;} + break; + + case 62: +#line 239 "pars0grm.y" + { (yyval) = &pars_sysdate_token; ;} + break; + + case 63: +#line 240 "pars0grm.y" + { (yyval) = &pars_rnd_token; ;} + break; + + case 64: +#line 241 "pars0grm.y" + { (yyval) = &pars_rnd_str_token; ;} + break; + + case 68: +#line 252 "pars0grm.y" + { (yyval) = pars_stored_procedure_call( + static_cast<sym_node_t*>((yyvsp[(2) - (6)]))); ;} + break; + + case 69: +#line 258 "pars0grm.y" + { (yyval) = pars_procedure_call((yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); ;} + break; + + case 70: +#line 262 "pars0grm.y" + { (yyval) = &pars_replstr_token; ;} + break; + + case 71: +#line 263 "pars0grm.y" + { (yyval) = &pars_printf_token; ;} + break; + + case 72: +#line 264 "pars0grm.y" + { (yyval) = &pars_assert_token; ;} + break; + + case 73: +#line 268 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (3)]); ;} + break; + + case 74: +#line 272 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 75: +#line 274 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 76: +#line 278 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 77: +#line 279 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 78: +#line 281 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 79: +#line 285 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 80: +#line 286 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)]));;} + break; + + case 81: +#line 287 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 82: +#line 291 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} + break; + + case 83: +#line 293 "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 84: +#line 298 "pars0grm.y" + { (yyval) = pars_func(&pars_count_token, + que_node_list_add_last(NULL, + pars_func(&pars_distinct_token, + que_node_list_add_last( + NULL, (yyvsp[(4) - (5)]))))); ;} + break; + + case 85: +#line 304 "pars0grm.y" + { (yyval) = pars_func(&pars_sum_token, + que_node_list_add_last(NULL, + (yyvsp[(3) - (4)]))); ;} + break; + + case 86: +#line 310 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 87: +#line 311 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 88: +#line 313 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 89: +#line 317 "pars0grm.y" + { (yyval) = pars_select_list(&pars_star_denoter, + NULL); ;} + break; + + case 90: +#line 320 "pars0grm.y" + { (yyval) = pars_select_list( + (yyvsp[(1) - (3)]), static_cast<sym_node_t*>((yyvsp[(3) - (3)]))); ;} + break; + + case 91: +#line 322 "pars0grm.y" + { (yyval) = pars_select_list((yyvsp[(1) - (1)]), NULL); ;} + break; + + case 92: +#line 326 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 93: +#line 327 "pars0grm.y" + { (yyval) = (yyvsp[(2) - (2)]); ;} + break; + + case 94: +#line 331 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 95: +#line 333 "pars0grm.y" + { (yyval) = &pars_update_token; ;} + break; + + case 96: +#line 337 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 97: +#line 339 "pars0grm.y" + { (yyval) = &pars_share_token; ;} + break; + + case 98: +#line 343 "pars0grm.y" + { (yyval) = &pars_asc_token; ;} + break; + + case 99: +#line 344 "pars0grm.y" + { (yyval) = &pars_asc_token; ;} + break; + + case 100: +#line 345 "pars0grm.y" + { (yyval) = &pars_desc_token; ;} + break; + + case 101: +#line 349 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 102: +#line 351 "pars0grm.y" + { (yyval) = pars_order_by( + static_cast<sym_node_t*>((yyvsp[(3) - (4)])), + static_cast<pars_res_word_t*>((yyvsp[(4) - (4)]))); ;} + break; + + case 103: +#line 362 "pars0grm.y" + { (yyval) = pars_select_statement( + static_cast<sel_node_t*>((yyvsp[(2) - (8)])), + static_cast<sym_node_t*>((yyvsp[(4) - (8)])), + static_cast<que_node_t*>((yyvsp[(5) - (8)])), + static_cast<pars_res_word_t*>((yyvsp[(6) - (8)])), + static_cast<pars_res_word_t*>((yyvsp[(7) - (8)])), + static_cast<order_node_t*>((yyvsp[(8) - (8)]))); ;} + break; + + case 104: +#line 373 "pars0grm.y" + { (yyval) = (yyvsp[(3) - (3)]); ;} + break; + + case 105: +#line 378 "pars0grm.y" + { (yyval) = pars_insert_statement( + static_cast<sym_node_t*>((yyvsp[(1) - (5)])), (yyvsp[(4) - (5)]), NULL); ;} + break; + + case 106: +#line 381 "pars0grm.y" + { (yyval) = pars_insert_statement( + static_cast<sym_node_t*>((yyvsp[(1) - (2)])), + NULL, + static_cast<sel_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 107: +#line 388 "pars0grm.y" + { (yyval) = pars_column_assignment( + static_cast<sym_node_t*>((yyvsp[(1) - (3)])), + static_cast<que_node_t*>((yyvsp[(3) - (3)]))); ;} + break; + + case 108: +#line 394 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 109: +#line 396 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 110: +#line 402 "pars0grm.y" + { (yyval) = (yyvsp[(4) - (4)]); ;} + break; + + case 111: +#line 408 "pars0grm.y" + { (yyval) = pars_update_statement_start( + FALSE, + static_cast<sym_node_t*>((yyvsp[(2) - (4)])), + static_cast<col_assign_node_t*>((yyvsp[(4) - (4)]))); ;} + break; + + case 112: +#line 416 "pars0grm.y" + { (yyval) = pars_update_statement( + static_cast<upd_node_t*>((yyvsp[(1) - (2)])), + NULL, + static_cast<que_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 113: +#line 424 "pars0grm.y" + { (yyval) = pars_update_statement( + static_cast<upd_node_t*>((yyvsp[(1) - (2)])), + static_cast<sym_node_t*>((yyvsp[(2) - (2)])), + NULL); ;} + break; + + case 114: +#line 432 "pars0grm.y" + { (yyval) = pars_update_statement_start( + TRUE, + static_cast<sym_node_t*>((yyvsp[(3) - (3)])), NULL); ;} + break; + + case 115: +#line 439 "pars0grm.y" + { (yyval) = pars_update_statement( + static_cast<upd_node_t*>((yyvsp[(1) - (2)])), + NULL, + static_cast<que_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 116: +#line 447 "pars0grm.y" + { (yyval) = pars_update_statement( + static_cast<upd_node_t*>((yyvsp[(1) - (2)])), + static_cast<sym_node_t*>((yyvsp[(2) - (2)])), + NULL); ;} + break; + + case 117: +#line 455 "pars0grm.y" + { (yyval) = pars_row_printf_statement( + static_cast<sel_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 118: +#line 461 "pars0grm.y" + { (yyval) = pars_assignment_statement( + static_cast<sym_node_t*>((yyvsp[(1) - (3)])), + static_cast<que_node_t*>((yyvsp[(3) - (3)]))); ;} + break; + + case 119: +#line 469 "pars0grm.y" + { (yyval) = pars_elsif_element((yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])); ;} + break; + + case 120: +#line 473 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 121: +#line 475 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); ;} + break; + + case 122: +#line 479 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 123: +#line 481 "pars0grm.y" + { (yyval) = (yyvsp[(2) - (2)]); ;} + break; + + case 124: +#line 482 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} + break; + + case 125: +#line 489 "pars0grm.y" + { (yyval) = pars_if_statement((yyvsp[(2) - (7)]), (yyvsp[(4) - (7)]), (yyvsp[(5) - (7)])); ;} + break; + + case 126: +#line 495 "pars0grm.y" + { (yyval) = pars_while_statement((yyvsp[(2) - (6)]), (yyvsp[(4) - (6)])); ;} + break; + + case 127: +#line 503 "pars0grm.y" + { (yyval) = pars_for_statement( + static_cast<sym_node_t*>((yyvsp[(2) - (10)])), + (yyvsp[(4) - (10)]), (yyvsp[(6) - (10)]), (yyvsp[(8) - (10)])); ;} + break; + + case 128: +#line 509 "pars0grm.y" + { (yyval) = pars_exit_statement(); ;} + break; + + case 129: +#line 513 "pars0grm.y" + { (yyval) = pars_return_statement(); ;} + break; + + case 130: +#line 518 "pars0grm.y" + { (yyval) = pars_open_statement( + ROW_SEL_OPEN_CURSOR, + static_cast<sym_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 131: +#line 525 "pars0grm.y" + { (yyval) = pars_open_statement( + ROW_SEL_CLOSE_CURSOR, + static_cast<sym_node_t*>((yyvsp[(2) - (2)]))); ;} + break; + + case 132: +#line 532 "pars0grm.y" + { (yyval) = pars_fetch_statement( + static_cast<sym_node_t*>((yyvsp[(2) - (4)])), + static_cast<sym_node_t*>((yyvsp[(4) - (4)])), NULL); ;} + break; + + case 133: +#line 536 "pars0grm.y" + { (yyval) = pars_fetch_statement( + static_cast<sym_node_t*>((yyvsp[(2) - (4)])), + NULL, + static_cast<sym_node_t*>((yyvsp[(4) - (4)]))); ;} + break; + + case 134: +#line 544 "pars0grm.y" + { (yyval) = pars_column_def( + static_cast<sym_node_t*>((yyvsp[(1) - (5)])), + static_cast<pars_res_word_t*>((yyvsp[(2) - (5)])), + static_cast<sym_node_t*>((yyvsp[(3) - (5)])), + (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); ;} + break; + + case 135: +#line 552 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 136: +#line 554 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 137: +#line 558 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 138: +#line 560 "pars0grm.y" + { (yyval) = (yyvsp[(2) - (3)]); ;} + break; + + case 139: +#line 564 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 140: +#line 566 "pars0grm.y" + { (yyval) = &pars_int_token; + /* pass any non-NULL pointer */ ;} + break; + + case 141: +#line 571 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 142: +#line 573 "pars0grm.y" + { (yyval) = &pars_int_token; + /* pass any non-NULL pointer */ ;} + break; + + case 143: +#line 578 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 144: +#line 580 "pars0grm.y" + { (yyval) = &pars_int_token; + /* pass any non-NULL pointer */ ;} + break; + + case 145: +#line 585 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 146: +#line 586 "pars0grm.y" + { (yyval) = &pars_int_token; + /* pass any non-NULL pointer */ ;} + break; + + case 147: +#line 591 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 148: +#line 593 "pars0grm.y" + { (yyval) = (yyvsp[(3) - (3)]); ;} + break; + + case 149: +#line 600 "pars0grm.y" + { (yyval) = pars_create_table( + static_cast<sym_node_t*>((yyvsp[(3) - (9)])), + static_cast<sym_node_t*>((yyvsp[(5) - (9)])), + static_cast<sym_node_t*>((yyvsp[(8) - (9)])), + static_cast<sym_node_t*>((yyvsp[(9) - (9)])), (yyvsp[(7) - (9)])); ;} + break; + + case 150: +#line 608 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 151: +#line 610 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 152: +#line 614 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 153: +#line 615 "pars0grm.y" + { (yyval) = &pars_unique_token; ;} + break; + + case 154: +#line 619 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 155: +#line 620 "pars0grm.y" + { (yyval) = &pars_clustered_token; ;} + break; + + case 156: +#line 629 "pars0grm.y" + { (yyval) = pars_create_index( + static_cast<pars_res_word_t*>((yyvsp[(2) - (10)])), + static_cast<pars_res_word_t*>((yyvsp[(3) - (10)])), + static_cast<sym_node_t*>((yyvsp[(5) - (10)])), + static_cast<sym_node_t*>((yyvsp[(7) - (10)])), + static_cast<sym_node_t*>((yyvsp[(9) - (10)]))); ;} + break; + + case 157: +#line 638 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} + break; + + case 158: +#line 639 "pars0grm.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} + break; + + case 159: +#line 644 "pars0grm.y" + { (yyval) = pars_commit_statement(); ;} + break; + + case 160: +#line 649 "pars0grm.y" + { (yyval) = pars_rollback_statement(); ;} + break; + + case 161: +#line 653 "pars0grm.y" + { (yyval) = &pars_int_token; ;} + break; + + case 162: +#line 654 "pars0grm.y" + { (yyval) = &pars_int_token; ;} + break; + + case 163: +#line 655 "pars0grm.y" + { (yyval) = &pars_bigint_token; ;} + break; + + case 164: +#line 656 "pars0grm.y" + { (yyval) = &pars_char_token; ;} + break; + + case 165: +#line 657 "pars0grm.y" + { (yyval) = &pars_binary_token; ;} + break; + + case 166: +#line 658 "pars0grm.y" + { (yyval) = &pars_blob_token; ;} + break; + + case 167: +#line 663 "pars0grm.y" + { (yyval) = pars_parameter_declaration( + static_cast<sym_node_t*>((yyvsp[(1) - (3)])), + PARS_INPUT, + static_cast<pars_res_word_t*>((yyvsp[(3) - (3)]))); ;} + break; + + case 168: +#line 668 "pars0grm.y" + { (yyval) = pars_parameter_declaration( + static_cast<sym_node_t*>((yyvsp[(1) - (3)])), + PARS_OUTPUT, + static_cast<pars_res_word_t*>((yyvsp[(3) - (3)]))); ;} + break; + + case 169: +#line 675 "pars0grm.y" + { (yyval) = NULL; ;} + break; + + case 170: +#line 676 "pars0grm.y" + { (yyval) = que_node_list_add_last(NULL, (yyvsp[(1) - (1)])); ;} + break; + + case 171: +#line 678 "pars0grm.y" + { (yyval) = que_node_list_add_last((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} + break; + + case 172: +#line 683 "pars0grm.y" + { (yyval) = pars_variable_declaration( + static_cast<sym_node_t*>((yyvsp[(1) - (3)])), + static_cast<pars_res_word_t*>((yyvsp[(2) - (3)]))); ;} + break; + + case 176: +#line 697 "pars0grm.y" + { (yyval) = pars_cursor_declaration( + static_cast<sym_node_t*>((yyvsp[(3) - (6)])), + static_cast<sel_node_t*>((yyvsp[(5) - (6)]))); ;} + break; + + case 177: +#line 704 "pars0grm.y" + { (yyval) = pars_function_declaration( + static_cast<sym_node_t*>((yyvsp[(3) - (4)]))); ;} + break; + + case 183: +#line 726 "pars0grm.y" + { (yyval) = pars_procedure_definition( + static_cast<sym_node_t*>((yyvsp[(2) - (11)])), + static_cast<sym_node_t*>((yyvsp[(4) - (11)])), + (yyvsp[(10) - (11)])); ;} + break; + + +/* Line 1267 of yacc.c. */ +#line 2826 "pars0grm.cc" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char*) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 732 "pars0grm.y" + + diff --git a/storage/innobase/pars/pars0grm.y b/storage/innobase/pars/pars0grm.y index 14d64f1826f..60913287cc4 100644 --- a/storage/innobase/pars/pars0grm.y +++ b/storage/innobase/pars/pars0grm.y @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ @@ -137,6 +137,15 @@ yylex(void); %token PARS_LOCK_TOKEN %token PARS_SHARE_TOKEN %token PARS_MODE_TOKEN +%token PARS_LIKE_TOKEN +%token PARS_LIKE_TOKEN_EXACT +%token PARS_LIKE_TOKEN_PREFIX +%token PARS_LIKE_TOKEN_SUFFIX +%token PARS_LIKE_TOKEN_SUBSTR +%token PARS_TABLE_NAME_TOKEN +%token PARS_COMPACT_TOKEN +%token PARS_BLOCK_SIZE_TOKEN +%token PARS_BIGINT_TOKEN %left PARS_AND_TOKEN PARS_OR_TOKEN %left PARS_NOT_TOKEN @@ -201,8 +210,10 @@ exp: | '-' exp %prec NEG { $$ = pars_op('-', $2, NULL); } | '(' exp ')' { $$ = $2; } | exp '=' exp { $$ = pars_op('=', $1, $3); } - | exp '<' exp { $$ = pars_op('<', $1, $3); } - | exp '>' exp { $$ = pars_op('>', $1, $3); } + | exp PARS_LIKE_TOKEN PARS_STR_LIT + { $$ = pars_op(PARS_LIKE_TOKEN, $1, $3); } + | exp '<' exp { $$ = pars_op('<', $1, $3); } + | exp '>' exp { $$ = pars_op('>', $1, $3); } | exp PARS_GE_TOKEN exp { $$ = pars_op(PARS_GE_TOKEN, $1, $3); } | exp PARS_LE_TOKEN exp { $$ = pars_op(PARS_LE_TOKEN, $1, $3); } | exp PARS_NE_TOKEN exp { $$ = pars_op(PARS_NE_TOKEN, $1, $3); } @@ -238,7 +249,8 @@ question_mark_list: stored_procedure_call: '{' PARS_ID_TOKEN '(' question_mark_list ')' '}' - { $$ = pars_stored_procedure_call($2); } + { $$ = pars_stored_procedure_call( + static_cast<sym_node_t*>($2)); } ; predefined_procedure_call: @@ -257,8 +269,8 @@ user_function_call: ; table_list: - PARS_ID_TOKEN { $$ = que_node_list_add_last(NULL, $1); } - | table_list ',' PARS_ID_TOKEN + table_name { $$ = que_node_list_add_last(NULL, $1); } + | table_list ',' table_name { $$ = que_node_list_add_last($1, $3); } ; @@ -305,7 +317,8 @@ select_list: '*' { $$ = pars_select_list(&pars_star_denoter, NULL); } | select_item_list PARS_INTO_TOKEN variable_list - { $$ = pars_select_list($1, $3); } + { $$ = pars_select_list( + $1, static_cast<sym_node_t*>($3)); } | select_item_list { $$ = pars_select_list($1, NULL); } ; @@ -335,7 +348,9 @@ order_direction: order_by_clause: /* Nothing */ { $$ = NULL; } | PARS_ORDER_TOKEN PARS_BY_TOKEN PARS_ID_TOKEN order_direction - { $$ = pars_order_by($3, $4); } + { $$ = pars_order_by( + static_cast<sym_node_t*>($3), + static_cast<pars_res_word_t*>($4)); } ; select_statement: @@ -344,24 +359,35 @@ select_statement: search_condition for_update_clause lock_shared_clause - order_by_clause { $$ = pars_select_statement($2, $4, $5, - $6, $7, $8); } + order_by_clause { $$ = pars_select_statement( + static_cast<sel_node_t*>($2), + static_cast<sym_node_t*>($4), + static_cast<que_node_t*>($5), + static_cast<pars_res_word_t*>($6), + static_cast<pars_res_word_t*>($7), + static_cast<order_node_t*>($8)); } ; insert_statement_start: PARS_INSERT_TOKEN PARS_INTO_TOKEN - PARS_ID_TOKEN { $$ = $3; } + table_name { $$ = $3; } ; insert_statement: insert_statement_start PARS_VALUES_TOKEN '(' exp_list ')' - { $$ = pars_insert_statement($1, $4, NULL); } + { $$ = pars_insert_statement( + static_cast<sym_node_t*>($1), $4, NULL); } | insert_statement_start select_statement - { $$ = pars_insert_statement($1, NULL, $2); } + { $$ = pars_insert_statement( + static_cast<sym_node_t*>($1), + NULL, + static_cast<sel_node_t*>($2)); } ; column_assignment: - PARS_ID_TOKEN '=' exp { $$ = pars_column_assignment($1, $3); } + PARS_ID_TOKEN '=' exp { $$ = pars_column_assignment( + static_cast<sym_node_t*>($1), + static_cast<que_node_t*>($3)); } ; column_assignment_list: @@ -377,46 +403,64 @@ cursor_positioned: ; update_statement_start: - PARS_UPDATE_TOKEN PARS_ID_TOKEN + PARS_UPDATE_TOKEN table_name PARS_SET_TOKEN - column_assignment_list { $$ = pars_update_statement_start(FALSE, - $2, $4); } + column_assignment_list { $$ = pars_update_statement_start( + FALSE, + static_cast<sym_node_t*>($2), + static_cast<col_assign_node_t*>($4)); } ; update_statement_searched: update_statement_start - search_condition { $$ = pars_update_statement($1, NULL, $2); } + search_condition { $$ = pars_update_statement( + static_cast<upd_node_t*>($1), + NULL, + static_cast<que_node_t*>($2)); } ; update_statement_positioned: update_statement_start - cursor_positioned { $$ = pars_update_statement($1, $2, NULL); } + cursor_positioned { $$ = pars_update_statement( + static_cast<upd_node_t*>($1), + static_cast<sym_node_t*>($2), + NULL); } ; delete_statement_start: PARS_DELETE_TOKEN PARS_FROM_TOKEN - PARS_ID_TOKEN { $$ = pars_update_statement_start(TRUE, - $3, NULL); } + table_name { $$ = pars_update_statement_start( + TRUE, + static_cast<sym_node_t*>($3), NULL); } ; delete_statement_searched: delete_statement_start - search_condition { $$ = pars_update_statement($1, NULL, $2); } + search_condition { $$ = pars_update_statement( + static_cast<upd_node_t*>($1), + NULL, + static_cast<que_node_t*>($2)); } ; delete_statement_positioned: delete_statement_start - cursor_positioned { $$ = pars_update_statement($1, $2, NULL); } + cursor_positioned { $$ = pars_update_statement( + static_cast<upd_node_t*>($1), + static_cast<sym_node_t*>($2), + NULL); } ; row_printf_statement: PARS_ROW_PRINTF_TOKEN select_statement - { $$ = pars_row_printf_statement($2); } + { $$ = pars_row_printf_statement( + static_cast<sel_node_t*>($2)); } ; assignment_statement: PARS_ID_TOKEN PARS_ASSIGN_TOKEN exp - { $$ = pars_assignment_statement($1, $3); } + { $$ = pars_assignment_statement( + static_cast<sym_node_t*>($1), + static_cast<que_node_t*>($3)); } ; elsif_element: @@ -456,7 +500,9 @@ for_statement: exp PARS_DDOT_TOKEN exp PARS_LOOP_TOKEN statement_list PARS_END_TOKEN PARS_LOOP_TOKEN - { $$ = pars_for_statement($2, $4, $6, $8); } + { $$ = pars_for_statement( + static_cast<sym_node_t*>($2), + $4, $6, $8); } ; exit_statement: @@ -470,25 +516,36 @@ return_statement: open_cursor_statement: PARS_OPEN_TOKEN PARS_ID_TOKEN { $$ = pars_open_statement( - ROW_SEL_OPEN_CURSOR, $2); } + ROW_SEL_OPEN_CURSOR, + static_cast<sym_node_t*>($2)); } ; close_cursor_statement: PARS_CLOSE_TOKEN PARS_ID_TOKEN { $$ = pars_open_statement( - ROW_SEL_CLOSE_CURSOR, $2); } + ROW_SEL_CLOSE_CURSOR, + static_cast<sym_node_t*>($2)); } ; fetch_statement: PARS_FETCH_TOKEN PARS_ID_TOKEN PARS_INTO_TOKEN variable_list - { $$ = pars_fetch_statement($2, $4, NULL); } + { $$ = pars_fetch_statement( + static_cast<sym_node_t*>($2), + static_cast<sym_node_t*>($4), NULL); } | PARS_FETCH_TOKEN PARS_ID_TOKEN PARS_INTO_TOKEN user_function_call - { $$ = pars_fetch_statement($2, NULL, $4); } + { $$ = pars_fetch_statement( + static_cast<sym_node_t*>($2), + NULL, + static_cast<sym_node_t*>($4)); } ; column_def: PARS_ID_TOKEN type_name opt_column_len opt_unsigned opt_not_null - { $$ = pars_column_def($1, $2, $3, $4, $5); } + { $$ = pars_column_def( + static_cast<sym_node_t*>($1), + static_cast<pars_res_word_t*>($2), + static_cast<sym_node_t*>($3), + $4, $5); } ; column_def_list: @@ -524,10 +581,27 @@ not_fit_in_memory: /* pass any non-NULL pointer */ } ; +compact: + /* Nothing */ { $$ = NULL; } + | PARS_COMPACT_TOKEN { $$ = &pars_int_token; + /* pass any non-NULL pointer */ } +; + +block_size: + /* Nothing */ { $$ = NULL; } + | PARS_BLOCK_SIZE_TOKEN '=' PARS_INT_LIT + { $$ = $3; } +; + create_table: PARS_CREATE_TOKEN PARS_TABLE_TOKEN - PARS_ID_TOKEN '(' column_def_list ')' - not_fit_in_memory { $$ = pars_create_table($3, $5, $7); } + table_name '(' column_def_list ')' + not_fit_in_memory compact block_size + { $$ = pars_create_table( + static_cast<sym_node_t*>($3), + static_cast<sym_node_t*>($5), + static_cast<sym_node_t*>($8), + static_cast<sym_node_t*>($9), $7); } ; column_list: @@ -550,8 +624,19 @@ create_index: PARS_CREATE_TOKEN unique_def clustered_def PARS_INDEX_TOKEN - PARS_ID_TOKEN PARS_ON_TOKEN PARS_ID_TOKEN - '(' column_list ')' { $$ = pars_create_index($2, $3, $5, $7, $9); } + PARS_ID_TOKEN PARS_ON_TOKEN + table_name + '(' column_list ')' { $$ = pars_create_index( + static_cast<pars_res_word_t*>($2), + static_cast<pars_res_word_t*>($3), + static_cast<sym_node_t*>($5), + static_cast<sym_node_t*>($7), + static_cast<sym_node_t*>($9)); } +; + +table_name: + PARS_ID_TOKEN { $$ = $1; } + | PARS_TABLE_NAME_TOKEN { $$ = $1; } ; commit_statement: @@ -567,6 +652,7 @@ rollback_statement: type_name: PARS_INT_TOKEN { $$ = &pars_int_token; } | PARS_INTEGER_TOKEN { $$ = &pars_int_token; } + | PARS_BIGINT_TOKEN { $$ = &pars_bigint_token; } | PARS_CHAR_TOKEN { $$ = &pars_char_token; } | PARS_BINARY_TOKEN { $$ = &pars_binary_token; } | PARS_BLOB_TOKEN { $$ = &pars_blob_token; } @@ -574,11 +660,15 @@ type_name: parameter_declaration: PARS_ID_TOKEN PARS_IN_TOKEN type_name - { $$ = pars_parameter_declaration($1, - PARS_INPUT, $3); } + { $$ = pars_parameter_declaration( + static_cast<sym_node_t*>($1), + PARS_INPUT, + static_cast<pars_res_word_t*>($3)); } | PARS_ID_TOKEN PARS_OUT_TOKEN type_name - { $$ = pars_parameter_declaration($1, - PARS_OUTPUT, $3); } + { $$ = pars_parameter_declaration( + static_cast<sym_node_t*>($1), + PARS_OUTPUT, + static_cast<pars_res_word_t*>($3)); } ; parameter_declaration_list: @@ -590,7 +680,9 @@ parameter_declaration_list: variable_declaration: PARS_ID_TOKEN type_name ';' - { $$ = pars_variable_declaration($1, $2); } + { $$ = pars_variable_declaration( + static_cast<sym_node_t*>($1), + static_cast<pars_res_word_t*>($2)); } ; variable_declaration_list: @@ -602,12 +694,15 @@ variable_declaration_list: cursor_declaration: PARS_DECLARE_TOKEN PARS_CURSOR_TOKEN PARS_ID_TOKEN PARS_IS_TOKEN select_statement ';' - { $$ = pars_cursor_declaration($3, $5); } + { $$ = pars_cursor_declaration( + static_cast<sym_node_t*>($3), + static_cast<sel_node_t*>($5)); } ; function_declaration: PARS_DECLARE_TOKEN PARS_FUNCTION_TOKEN PARS_ID_TOKEN ';' - { $$ = pars_function_declaration($3); } + { $$ = pars_function_declaration( + static_cast<sym_node_t*>($3)); } ; declaration: @@ -628,8 +723,10 @@ procedure_definition: declaration_list PARS_BEGIN_TOKEN statement_list - PARS_END_TOKEN { $$ = pars_procedure_definition($2, $4, - $10); } + PARS_END_TOKEN { $$ = pars_procedure_definition( + static_cast<sym_node_t*>($2), + static_cast<sym_node_t*>($4), + $10); } ; %% diff --git a/storage/innobase/pars/pars0lex.l b/storage/innobase/pars/pars0lex.l index 55ed17f82e1..2446e40cde8 100644 --- a/storage/innobase/pars/pars0lex.l +++ b/storage/innobase/pars/pars0lex.l @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ @@ -64,7 +64,9 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) +/* Note: We cast &result to int* from yysize_t* */ +#define YY_INPUT(buf, result, max_size) \ + pars_get_lex_chars(buf, (int*) &result, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -79,7 +81,7 @@ string_append( ulint len) /*!< in: length of the string */ { if (stringbuf == NULL) { - stringbuf = malloc(1); + stringbuf = static_cast<char*>(malloc(1)); stringbuf_len_alloc = 1; } @@ -87,7 +89,9 @@ string_append( while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = realloc(stringbuf, stringbuf_len_alloc); + + stringbuf = static_cast<char*>( + realloc(stringbuf, stringbuf_len_alloc)); } memcpy(stringbuf + stringbuf_len, str, len); @@ -96,8 +100,9 @@ string_append( %} -DIGIT [0-9] -ID [a-z_A-Z][a-z_A-Z0-9]* +DIGIT [0-9] +ID [a-z_A-Z][a-z_A-Z0-9]* +TABLE_NAME [a-z_A-Z][a-z_A-Z0-9]*\/(#sql-|[a-z_A-Z])[a-z_A-Z0-9]* BOUND_LIT \:[a-z_A-Z0-9]+ BOUND_ID \$[a-z_A-Z0-9]+ @@ -249,27 +254,27 @@ In the state 'id', only two actions are possible (defined below). */ } "BINARY" { - return(PARS_BINARY_TOKEN); + return(PARS_BINARY_TOKEN); } "BLOB" { - return(PARS_BLOB_TOKEN); + return(PARS_BLOB_TOKEN); } "INT" { - return(PARS_INT_TOKEN); + return(PARS_INT_TOKEN); } "INTEGER" { - return(PARS_INT_TOKEN); + return(PARS_INT_TOKEN); } "FLOAT" { - return(PARS_FLOAT_TOKEN); + return(PARS_FLOAT_TOKEN); } "CHAR" { - return(PARS_CHAR_TOKEN); + return(PARS_CHAR_TOKEN); } "IS" { @@ -400,16 +405,24 @@ In the state 'id', only two actions are possible (defined below). */ return(PARS_TABLE_TOKEN); } +"COMPACT" { + return(PARS_COMPACT_TOKEN); +} + +"BLOCK_SIZE" { + return(PARS_BLOCK_SIZE_TOKEN); +} + "INDEX" { - return(PARS_INDEX_TOKEN); + return(PARS_INDEX_TOKEN); } "UNIQUE" { - return(PARS_UNIQUE_TOKEN); + return(PARS_UNIQUE_TOKEN); } "CLUSTERED" { - return(PARS_CLUSTERED_TOKEN); + return(PARS_CLUSTERED_TOKEN); } "DOES_NOT_FIT_IN_MEMORY" { @@ -417,7 +430,7 @@ In the state 'id', only two actions are possible (defined below). */ } "ON" { - return(PARS_ON_TOKEN); + return(PARS_ON_TOKEN); } "DECLARE" { @@ -540,13 +553,28 @@ In the state 'id', only two actions are possible (defined below). */ return(PARS_MODE_TOKEN); } +"LIKE" { + return(PARS_LIKE_TOKEN); +} + +"BIGINT" { + return(PARS_BIGINT_TOKEN); +} + {ID} { yylval = sym_tab_add_id(pars_sym_tab_global, - (byte*)yytext, + (byte*) yytext, ut_strlen(yytext)); return(PARS_ID_TOKEN); } +{TABLE_NAME} { + yylval = sym_tab_add_id(pars_sym_tab_global, + (byte*) yytext, + ut_strlen(yytext)); + return(PARS_TABLE_NAME_TOKEN); +} + ".." { return(PARS_DDOT_TOKEN); } diff --git a/storage/innobase/pars/pars0opt.c b/storage/innobase/pars/pars0opt.cc index d992805d9ef..e5f347eedd6 100644 --- a/storage/innobase/pars/pars0opt.c +++ b/storage/innobase/pars/pars0opt.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -11,13 +11,13 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ /**************************************************//** -@file pars/pars0opt.c +@file pars/pars0opt.cc Simple SQL optimizer Created 12/21/1997 Heikki Tuuri @@ -68,6 +68,7 @@ opt_invert_cmp_op( } else if (op == PARS_GE_TOKEN) { return(PARS_LE_TOKEN); } else { + /* TODO: LIKE operator */ ut_error; } @@ -96,7 +97,7 @@ opt_check_exp_determined_before( ut_ad(exp && sel_node); if (que_node_get_type(exp) == QUE_NODE_FUNC) { - func_node = exp; + func_node = static_cast<func_node_t*>(exp); arg = func_node->args; @@ -114,7 +115,7 @@ opt_check_exp_determined_before( ut_a(que_node_get_type(exp) == QUE_NODE_SYMBOL); - sym_node = exp; + sym_node = static_cast<sym_node_t*>(exp); if (sym_node->token_type != SYM_COLUMN) { @@ -165,11 +166,18 @@ opt_look_for_col_in_comparison_before( || (search_cond->func == '>') || (search_cond->func == '=') || (search_cond->func == PARS_GE_TOKEN) - || (search_cond->func == PARS_LE_TOKEN)); + || (search_cond->func == PARS_LE_TOKEN) + || (search_cond->func == PARS_LIKE_TOKEN_EXACT) + || (search_cond->func == PARS_LIKE_TOKEN_PREFIX) + || (search_cond->func == PARS_LIKE_TOKEN_SUFFIX) + || (search_cond->func == PARS_LIKE_TOKEN_SUBSTR)); table = sel_node_get_nth_plan(sel_node, nth_table)->table; - if ((cmp_type == OPT_EQUAL) && (search_cond->func != '=')) { + if ((cmp_type == OPT_EQUAL) + && (search_cond->func != '=') + && (search_cond->func != PARS_LIKE_TOKEN_EXACT) + && (search_cond->func != PARS_LIKE_TOKEN_PREFIX)) { return(NULL); @@ -177,7 +185,9 @@ opt_look_for_col_in_comparison_before( && (search_cond->func != '<') && (search_cond->func != '>') && (search_cond->func != PARS_GE_TOKEN) - && (search_cond->func != PARS_LE_TOKEN)) { + && (search_cond->func != PARS_LE_TOKEN) + && (search_cond->func != PARS_LIKE_TOKEN_PREFIX) + && (search_cond->func != PARS_LIKE_TOKEN_SUFFIX)) { return(NULL); } @@ -185,7 +195,7 @@ opt_look_for_col_in_comparison_before( arg = search_cond->args; if (que_node_get_type(arg) == QUE_NODE_SYMBOL) { - sym_node = arg; + sym_node = static_cast<sym_node_t*>(arg); if ((sym_node->token_type == SYM_COLUMN) && (sym_node->table == table) @@ -211,7 +221,7 @@ opt_look_for_col_in_comparison_before( arg = que_node_get_next(arg); if (que_node_get_type(arg) == QUE_NODE_SYMBOL) { - sym_node = arg; + sym_node = static_cast<sym_node_t*>(arg); if ((sym_node->token_type == SYM_COLUMN) && (sym_node->table == table) @@ -262,7 +272,7 @@ opt_look_for_col_in_cond_before( ut_a(search_cond->func != PARS_NOT_TOKEN); if (search_cond->func == PARS_AND_TOKEN) { - new_cond = search_cond->args; + new_cond = static_cast<func_node_t*>(search_cond->args); exp = opt_look_for_col_in_cond_before(cmp_type, col_no, new_cond, sel_node, @@ -272,7 +282,8 @@ opt_look_for_col_in_cond_before( return(exp); } - new_cond = que_node_get_next(new_cond); + new_cond = static_cast<func_node_t*>( + que_node_get_next(new_cond)); exp = opt_look_for_col_in_cond_before(cmp_type, col_no, new_cond, sel_node, @@ -332,6 +343,12 @@ opt_calc_index_goodness( ulint op; ulint j; + /* At least for now we don't support using FTS indexes for queries + done through InnoDB's own SQL parser. */ + if (index->type == DICT_FTS) { + return(0); + } + goodness = 0; /* Note that as higher level node pointers in the B-tree contain @@ -346,7 +363,8 @@ opt_calc_index_goodness( col_no = dict_index_get_nth_col_no(index, j); exp = opt_look_for_col_in_cond_before( - OPT_EQUAL, col_no, sel_node->search_cond, + OPT_EQUAL, col_no, + static_cast<func_node_t*>(sel_node->search_cond), sel_node, nth_table, &op); if (exp) { /* The value for this column is exactly known already @@ -359,7 +377,9 @@ opt_calc_index_goodness( /* Look for non-equality comparisons */ exp = opt_look_for_col_in_cond_before( - OPT_COMPARISON, col_no, sel_node->search_cond, + OPT_COMPARISON, col_no, + static_cast<func_node_t*>( + sel_node->search_cond), sel_node, nth_table, &op); if (exp) { index_plan[j] = exp; @@ -413,7 +433,12 @@ opt_op_to_search_mode( ascending order */ ulint op) /*!< in: operator '=', PARS_GE_TOKEN, ... */ { - if (op == '=') { + if (op == '=' + || op == PARS_LIKE_TOKEN_EXACT + || op == PARS_LIKE_TOKEN_PREFIX + || op == PARS_LIKE_TOKEN_SUFFIX + || op == PARS_LIKE_TOKEN_SUBSTR) { + if (asc) { return(PAGE_CUR_GE); } else { @@ -583,12 +608,18 @@ opt_search_plan_for_table( n_fields); dict_index_copy_types(plan->tuple, plan->index, n_fields); - plan->tuple_exps = mem_heap_alloc(pars_sym_tab_global->heap, - n_fields * sizeof(void*)); + plan->tuple_exps = static_cast<que_node_t**>( + mem_heap_alloc( + pars_sym_tab_global->heap, + n_fields * sizeof(void*))); ut_memcpy(plan->tuple_exps, best_index_plan, n_fields * sizeof(void*)); - if (best_last_op == '=') { + if (best_last_op == '=' + || best_last_op == PARS_LIKE_TOKEN_EXACT + || best_last_op == PARS_LIKE_TOKEN_PREFIX + || best_last_op == PARS_LIKE_TOKEN_SUFFIX + || best_last_op == PARS_LIKE_TOKEN_SUBSTR) { plan->n_exact_match = n_fields; } else { plan->n_exact_match = n_fields - 1; @@ -717,7 +748,7 @@ opt_find_test_conds( conditions or NULL */ { func_node_t* new_cond; - ulint class; + ulint fclass; plan_t* plan; if (cond == NULL) { @@ -726,11 +757,12 @@ opt_find_test_conds( } if (cond->func == PARS_AND_TOKEN) { - new_cond = cond->args; + new_cond = static_cast<func_node_t*>(cond->args); opt_find_test_conds(sel_node, i, new_cond); - new_cond = que_node_get_next(new_cond); + new_cond = static_cast<func_node_t*>( + que_node_get_next(new_cond)); opt_find_test_conds(sel_node, i, new_cond); @@ -739,12 +771,12 @@ opt_find_test_conds( plan = sel_node_get_nth_plan(sel_node, i); - class = opt_classify_comparison(sel_node, i, cond); + fclass = opt_classify_comparison(sel_node, i, cond); - if (class == OPT_END_COND) { + if (fclass == OPT_END_COND) { UT_LIST_ADD_LAST(cond_list, plan->end_conds, cond); - } else if (class == OPT_TEST_COND) { + } else if (fclass == OPT_TEST_COND) { UT_LIST_ADD_LAST(cond_list, plan->other_conds, cond); } @@ -772,7 +804,7 @@ opt_normalize_cmp_conds( if (que_node_get_type(arg2) == QUE_NODE_SYMBOL) { - sym_node = arg2; + sym_node = static_cast<sym_node_t*>(arg2); if ((sym_node->token_type == SYM_COLUMN) && (sym_node->table == table)) { @@ -812,7 +844,10 @@ opt_determine_and_normalize_test_conds( /* Recursively go through the conjuncts and classify them */ - opt_find_test_conds(sel_node, i, sel_node->search_cond); + opt_find_test_conds( + sel_node, + i, + static_cast<func_node_t*>(sel_node->search_cond)); opt_normalize_cmp_conds(UT_LIST_GET_FIRST(plan->end_conds), plan->table); @@ -852,14 +887,14 @@ opt_find_all_cols( } if (que_node_get_type(exp) == QUE_NODE_FUNC) { - func_node = exp; + func_node = static_cast<func_node_t*>(exp); - arg = func_node->args; + for (arg = func_node->args; + arg != 0; + arg = que_node_get_next(arg)) { - while (arg) { - opt_find_all_cols(copy_val, index, col_list, plan, - arg); - arg = que_node_get_next(arg); + opt_find_all_cols( + copy_val, index, col_list, plan, arg); } return; @@ -867,7 +902,7 @@ opt_find_all_cols( ut_a(que_node_get_type(exp) == QUE_NODE_SYMBOL); - sym_node = exp; + sym_node = static_cast<sym_node_t*>(exp); if (sym_node->token_type != SYM_COLUMN) { @@ -953,11 +988,12 @@ opt_find_copy_cols( ut_ad(que_node_get_type(search_cond) == QUE_NODE_FUNC); if (search_cond->func == PARS_AND_TOKEN) { - new_cond = search_cond->args; + new_cond = static_cast<func_node_t*>(search_cond->args); opt_find_copy_cols(sel_node, i, new_cond); - new_cond = que_node_get_next(new_cond); + new_cond = static_cast<func_node_t*>( + que_node_get_next(new_cond)); opt_find_copy_cols(sel_node, i, new_cond); @@ -1004,21 +1040,23 @@ opt_classify_cols( /* All select list columns should be copied: therefore TRUE as the first argument */ - exp = sel_node->select_list; + for (exp = sel_node->select_list; + exp != 0; + exp = que_node_get_next(exp)) { - while (exp) { - opt_find_all_cols(TRUE, plan->index, &(plan->columns), plan, - exp); - exp = que_node_get_next(exp); + opt_find_all_cols( + TRUE, plan->index, &(plan->columns), plan, exp); } - opt_find_copy_cols(sel_node, i, sel_node->search_cond); + opt_find_copy_cols( + sel_node, i, static_cast<func_node_t*>(sel_node->search_cond)); /* All remaining columns in the search condition are temporary columns: therefore FALSE */ - opt_find_all_cols(FALSE, plan->index, &(plan->columns), plan, - sel_node->search_cond); + opt_find_all_cols( + FALSE, plan->index, &plan->columns, plan, + static_cast<func_node_t*>(sel_node->search_cond)); } /*******************************************************************//** @@ -1068,7 +1106,8 @@ opt_clust_access( dict_index_copy_types(plan->clust_ref, clust_index, n_fields); - plan->clust_map = mem_heap_alloc(heap, n_fields * sizeof(ulint)); + plan->clust_map = static_cast<ulint*>( + mem_heap_alloc(heap, n_fields * sizeof(ulint))); for (i = 0; i < n_fields; i++) { pos = dict_index_get_nth_field_pos(index, clust_index, i); @@ -1082,7 +1121,7 @@ opt_clust_access( || dict_index_get_nth_field(clust_index, i) ->prefix_len != 0) { fprintf(stderr, - "InnoDB: Error in pars0opt.c:" + "InnoDB: Error in pars0opt.cc:" " table %s has prefix_len != 0\n", index->table_name); } @@ -1108,8 +1147,10 @@ opt_search_plan( order_node_t* order_by; ulint i; - sel_node->plans = mem_heap_alloc(pars_sym_tab_global->heap, - sel_node->n_tables * sizeof(plan_t)); + sel_node->plans = static_cast<plan_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, + sel_node->n_tables * sizeof(plan_t))); /* Analyze the search condition to find out what we know at each join stage about the conditions that the columns of a table should @@ -1138,7 +1179,8 @@ opt_search_plan( opt_determine_and_normalize_test_conds(sel_node, i); - table_node = que_node_get_next(table_node); + table_node = static_cast<sym_node_t*>( + que_node_get_next(table_node)); } table_node = sel_node->table_list; @@ -1155,7 +1197,8 @@ opt_search_plan( opt_clust_access(sel_node, i); - table_node = que_node_get_next(table_node); + table_node = static_cast<sym_node_t*>( + que_node_get_next(table_node)); } /* Check that the plan obeys a possible order-by clause: if not, diff --git a/storage/innobase/pars/pars0pars.c b/storage/innobase/pars/pars0pars.cc index 86f54195682..a4ab85adc36 100644 --- a/storage/innobase/pars/pars0pars.c +++ b/storage/innobase/pars/pars0pars.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. +Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -81,6 +81,7 @@ UNIV_INTERN pars_res_word_t pars_distinct_token = {PARS_DISTINCT_TOKEN}; UNIV_INTERN pars_res_word_t pars_binary_token = {PARS_BINARY_TOKEN}; UNIV_INTERN pars_res_word_t pars_blob_token = {PARS_BLOB_TOKEN}; UNIV_INTERN pars_res_word_t pars_int_token = {PARS_INT_TOKEN}; +UNIV_INTERN pars_res_word_t pars_bigint_token = {PARS_BIGINT_TOKEN}; UNIV_INTERN pars_res_word_t pars_char_token = {PARS_CHAR_TOKEN}; UNIV_INTERN pars_res_word_t pars_float_token = {PARS_FLOAT_TOKEN}; UNIV_INTERN pars_res_word_t pars_update_token = {PARS_UPDATE_TOKEN}; @@ -95,6 +96,95 @@ UNIV_INTERN pars_res_word_t pars_clustered_token = {PARS_CLUSTERED_TOKEN}; /** Global variable used to denote the '*' in SELECT * FROM.. */ UNIV_INTERN ulint pars_star_denoter = 12345678; +/******************************************************************** +Get user function with the given name.*/ +UNIV_INLINE +pars_user_func_t* +pars_info_lookup_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*/ +{ + if (info && info->funcs) { + ulint i; + ib_vector_t* vec = info->funcs; + + for (i = 0; i < ib_vector_size(vec); i++) { + pars_user_func_t* puf; + + puf = static_cast<pars_user_func_t*>( + ib_vector_get(vec, i)); + + if (strcmp(puf->name, name) == 0) { + return(puf); + } + } + } + + return(NULL); +} + +/******************************************************************** +Get bound identifier with the given name.*/ +UNIV_INLINE +pars_bound_id_t* +pars_info_lookup_bound_id( +/*======================*/ + /* out: bound literal, or NULL if + not found */ + pars_info_t* info, /* in: info struct */ + const char* name) /* in: bound literal name to find */ +{ + if (info && info->bound_ids) { + ulint i; + ib_vector_t* vec = info->bound_ids; + + for (i = 0; i < ib_vector_size(vec); i++) { + pars_bound_id_t* bid; + + bid = static_cast<pars_bound_id_t*>( + ib_vector_get(vec, i)); + + if (strcmp(bid->name, name) == 0) { + return(bid); + } + } + } + + return(NULL); +} + +/******************************************************************** +Get bound literal with the given name.*/ +UNIV_INLINE +pars_bound_lit_t* +pars_info_lookup_bound_lit( +/*=======================*/ + /* out: bound literal, or NULL if + not found */ + pars_info_t* info, /* in: info struct */ + const char* name) /* in: bound literal name to find */ +{ + if (info && info->bound_lits) { + ulint i; + ib_vector_t* vec = info->bound_lits; + + for (i = 0; i < ib_vector_size(vec); i++) { + pars_bound_lit_t* pbl; + + pbl = static_cast<pars_bound_lit_t*>( + ib_vector_get(vec, i)); + + if (strcmp(pbl->name, name) == 0) { + return(pbl); + } + } + } + + return(NULL); +} /*********************************************************************//** Determines the class of a function code. @@ -153,7 +243,8 @@ pars_func_low( { func_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(func_node_t)); + node = static_cast<func_node_t*>( + mem_heap_alloc(pars_sym_tab_global->heap, sizeof(func_node_t))); node->common.type = QUE_NODE_FUNC; dfield_set_data(&(node->common.val), NULL, 0); @@ -161,7 +252,7 @@ pars_func_low( node->func = func; - node->class = pars_func_get_class(func); + node->fclass = pars_func_get_class(func); node->args = arg; @@ -180,9 +271,183 @@ pars_func( que_node_t* res_word,/*!< in: function name reserved word */ que_node_t* arg) /*!< in: first argument in the argument list */ { - return(pars_func_low(((pars_res_word_t*)res_word)->code, arg)); + return(pars_func_low(((pars_res_word_t*) res_word)->code, arg)); } +/************************************************************************* +Rebind a LIKE search string. NOTE: We ignore any '%' characters embedded +within the search string.*/ + +int +pars_like_rebind( +/*=============*/ + /* out, own: function node in a query tree */ + sym_node_t* node, /* in: The search string node.*/ + const byte* ptr, /* in: literal to (re) bind */ + ulint ptr_len)/* in: length of literal to (re) bind*/ +{ + dtype_t* dtype; + dfield_t* dfield; + ib_like_t op_check; + sym_node_t* like_node; + sym_node_t* str_node = NULL; + ib_like_t op = IB_LIKE_EXACT; + int func = PARS_LIKE_TOKEN_EXACT; + + /* Is this a STRING% ? */ + if (ptr[ptr_len - 1] == '%') { + op = IB_LIKE_PREFIX; + } + + /* Is this a '%STRING' or %STRING% ?*/ + if (*ptr == '%') { + op = (op == IB_LIKE_PREFIX) ? IB_LIKE_SUBSTR : IB_LIKE_SUFFIX; + } + + if (node->like_node == NULL) { + /* Add the LIKE operator info node to the node list. + This will be used during the comparison phase to determine + how to match.*/ + like_node = sym_tab_add_int_lit(node->sym_table, op); + que_node_list_add_last(NULL, like_node); + node->like_node = like_node; + str_node = sym_tab_add_str_lit(node->sym_table, ptr, ptr_len); + que_node_list_add_last(like_node, str_node); + } else { + like_node = node->like_node; + + /* Change the value of the string in the existing + string node of like node */ + str_node = static_cast<sym_node_t*>( + que_node_list_get_last(like_node)); + + /* Must find the string node */ + ut_a(str_node); + ut_a(str_node != like_node); + ut_a(str_node->token_type == SYM_LIT); + + dfield = que_node_get_val(str_node); + dfield_set_data(dfield, ptr, ptr_len); + } + + dfield = que_node_get_val(like_node); + dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_INT); + op_check = static_cast<ib_like_t>( + mach_read_from_4(static_cast<byte*>(dfield_get_data(dfield)))); + + switch (op_check) { + case IB_LIKE_PREFIX: + case IB_LIKE_SUFFIX: + case IB_LIKE_SUBSTR: + case IB_LIKE_EXACT: + break; + + default: + ut_error; + } + + mach_write_to_4(static_cast<byte*>(dfield_get_data(dfield)), op); + + dfield = que_node_get_val(node); + + /* Adjust the length of the search value so the '%' is not + visible. Then create and add a search string node to the + search value node. Searching for %SUFFIX and %SUBSTR% requires + a full table scan and so we set the search value to ''. + For PREFIX% we simply remove the trailing '%'.*/ + + switch (op) { + case IB_LIKE_EXACT: + dfield = que_node_get_val(str_node); + dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_VARCHAR); + + dfield_set_data(dfield, ptr, ptr_len); + break; + + case IB_LIKE_PREFIX: + func = PARS_LIKE_TOKEN_PREFIX; + + /* Modify the original node */ + dfield_set_len(dfield, ptr_len - 1); + + dfield = que_node_get_val(str_node); + dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_VARCHAR); + + dfield_set_data(dfield, ptr, ptr_len - 1); + break; + + case IB_LIKE_SUFFIX: + func = PARS_LIKE_TOKEN_SUFFIX; + + /* Modify the original node */ + /* Make it an '' empty string */ + dfield_set_len(dfield, 0); + + dfield = que_node_get_val(str_node); + dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_VARCHAR); + + dfield_set_data(dfield, ptr + 1, ptr_len - 1); + break; + + case IB_LIKE_SUBSTR: + func = PARS_LIKE_TOKEN_SUBSTR; + + /* Modify the original node */ + /* Make it an '' empty string */ + dfield_set_len(dfield, 0); + + dfield = que_node_get_val(str_node); + dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_VARCHAR); + + dfield_set_data(dfield, ptr + 1, ptr_len - 2); + break; + + default: + ut_error; + } + + return(func); +} + +/************************************************************************* +Parses a LIKE operator expression. */ +static +int +pars_like_op( +/*=========*/ + /* out, own: function node in a query tree */ + que_node_t* arg) /* in: LIKE comparison string.*/ +{ + char* ptr; + ulint ptr_len; + int func = PARS_LIKE_TOKEN_EXACT; + dfield_t* dfield = que_node_get_val(arg); + dtype_t* dtype = dfield_get_type(dfield); + + ut_a(dtype_get_mtype(dtype) == DATA_CHAR + || dtype_get_mtype(dtype) == DATA_VARCHAR); + + ptr = static_cast<char*>(dfield_get_data(dfield)); + ptr_len = strlen(ptr); + + if (ptr_len) { + + func = pars_like_rebind( + static_cast<sym_node_t*>(arg), (byte*) ptr, ptr_len); + } + + return(func); +} /*********************************************************************//** Parses an operator expression. @return own: function node in a query tree */ @@ -201,6 +466,20 @@ pars_op( que_node_list_add_last(arg1, arg2); } + /* We need to parse the string and determine whether it's a + PREFIX, SUFFIX or SUBSTRING comparison */ + if (func == PARS_LIKE_TOKEN) { + + ut_a(que_node_get_type(arg2) == QUE_NODE_SYMBOL); + + func = pars_like_op(arg2); + + ut_a(func == PARS_LIKE_TOKEN_EXACT + || func == PARS_LIKE_TOKEN_PREFIX + || func == PARS_LIKE_TOKEN_SUFFIX + || func == PARS_LIKE_TOKEN_SUBSTR); + } + return(pars_func_low(func, arg1)); } @@ -216,7 +495,9 @@ pars_order_by( { order_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(order_node_t)); + node = static_cast<order_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(order_node_t))); node->common.type = QUE_NODE_ORDER; @@ -339,6 +620,14 @@ pars_resolve_func_data_type( dtype_set(que_node_get_data_type(node), DATA_INT, 0, 4); break; + case PARS_LIKE_TOKEN_EXACT: + case PARS_LIKE_TOKEN_PREFIX: + case PARS_LIKE_TOKEN_SUFFIX: + case PARS_LIKE_TOKEN_SUBSTR: + dtype_set(que_node_get_data_type(node), DATA_VARCHAR, + DATA_ENGLISH, 0); + break; + default: ut_error; } @@ -365,7 +654,7 @@ pars_resolve_exp_variables_and_types( ut_a(exp_node); if (que_node_get_type(exp_node) == QUE_NODE_FUNC) { - func_node = exp_node; + func_node = static_cast<func_node_t*>(exp_node); arg = func_node->args; @@ -382,7 +671,7 @@ pars_resolve_exp_variables_and_types( ut_a(que_node_get_type(exp_node) == QUE_NODE_SYMBOL); - sym_node = exp_node; + sym_node = static_cast<sym_node_t*>(exp_node); if (sym_node->resolved) { @@ -473,7 +762,7 @@ pars_resolve_exp_columns( ut_a(exp_node); if (que_node_get_type(exp_node) == QUE_NODE_FUNC) { - func_node = exp_node; + func_node = static_cast<func_node_t*>(exp_node); arg = func_node->args; @@ -488,7 +777,7 @@ pars_resolve_exp_columns( ut_a(que_node_get_type(exp_node) == QUE_NODE_SYMBOL); - sym_node = exp_node; + sym_node = static_cast<sym_node_t*>(exp_node); if (sym_node->resolved) { @@ -530,7 +819,7 @@ pars_resolve_exp_columns( } } - t_node = que_node_get_next(t_node); + t_node = static_cast<sym_node_t*>(que_node_get_next(t_node)); } } @@ -559,19 +848,21 @@ pars_retrieve_table_def( /*====================*/ sym_node_t* sym_node) /*!< in: table node */ { - const char* table_name; - ut_a(sym_node); ut_a(que_node_get_type(sym_node) == QUE_NODE_SYMBOL); - sym_node->resolved = TRUE; - sym_node->token_type = SYM_TABLE; + /* Open the table only if it is not already opened. */ + if (sym_node->token_type != SYM_TABLE_REF_COUNTED) { - table_name = (const char*) sym_node->name; + ut_a(sym_node->table == NULL); - sym_node->table = dict_table_get_low(table_name); + sym_node->resolved = TRUE; + sym_node->token_type = SYM_TABLE_REF_COUNTED; - ut_a(sym_node->table); + sym_node->table = dict_table_open_on_name(sym_node->name, TRUE); + + ut_a(sym_node->table != NULL); + } } /*********************************************************************//** @@ -595,7 +886,8 @@ pars_retrieve_table_list_defs( count++; - sym_node = que_node_get_next(sym_node); + sym_node = static_cast<sym_node_t*>( + que_node_get_next(sym_node)); } return(count); @@ -627,14 +919,15 @@ pars_select_all_columns( table, i); col_node = sym_tab_add_id(pars_sym_tab_global, - (byte*)col_name, + (byte*) col_name, ut_strlen(col_name)); select_node->select_list = que_node_list_add_last( select_node->select_list, col_node); } - table_node = que_node_get_next(table_node); + table_node = static_cast<sym_node_t*>( + que_node_get_next(table_node)); } } @@ -684,9 +977,9 @@ pars_check_aggregate( if (que_node_get_type(exp_node) == QUE_NODE_FUNC) { - func_node = exp_node; + func_node = static_cast<func_node_t*>(exp_node); - if (func_node->class == PARS_FUNC_AGGREGATE) { + if (func_node->fclass == PARS_FUNC_AGGREGATE) { n_aggregate_nodes++; } @@ -864,8 +1157,9 @@ pars_column_assignment( { col_assign_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, - sizeof(col_assign_node_t)); + node = static_cast<col_assign_node_t*>( + mem_heap_alloc(pars_sym_tab_global->heap, + sizeof(col_assign_node_t))); node->common.type = QUE_NODE_COL_ASSIGNMENT; node->col = column; @@ -894,7 +1188,8 @@ pars_process_assign_list( ulint i; table_sym = node->table_sym; - col_assign_list = node->col_assign_list; + col_assign_list = static_cast<col_assign_node_t*>( + node->col_assign_list); clust_index = dict_table_get_first_index(node->table); assign_node = col_assign_list; @@ -920,7 +1215,8 @@ pars_process_assign_list( assign_node->val); n_assigns++; - assign_node = que_node_get_next(assign_node); + assign_node = static_cast<col_assign_node_t*>( + que_node_get_next(assign_node)); } node->update = upd_create(n_assigns, pars_sym_tab_global->heap); @@ -946,7 +1242,8 @@ pars_process_assign_list( changes_field_size = 0; } - assign_node = que_node_get_next(assign_node); + assign_node = static_cast<col_assign_node_t*>( + que_node_get_next(assign_node)); } /* Find out if the update can modify an ordering field in any index */ @@ -1129,16 +1426,20 @@ pars_set_dfield_type( flags |= DATA_UNSIGNED; } - if (type == &pars_int_token) { + if (type == &pars_bigint_token) { + ut_a(len == 0); + + dtype_set(dfield_get_type(dfield), DATA_INT, flags, 8); + } else if (type == &pars_int_token) { ut_a(len == 0); dtype_set(dfield_get_type(dfield), DATA_INT, flags, 4); } else if (type == &pars_char_token) { - ut_a(len == 0); + //ut_a(len == 0); dtype_set(dfield_get_type(dfield), DATA_VARCHAR, - DATA_ENGLISH | flags, 0); + DATA_ENGLISH | flags, len); } else if (type == &pars_binary_token) { ut_a(len != 0); @@ -1209,12 +1510,12 @@ pars_set_parent_in_list( { que_common_t* common; - common = node_list; + common = static_cast<que_common_t*>(node_list); while (common) { common->parent = parent; - common = que_node_get_next(common); + common = static_cast<que_common_t*>(que_node_get_next(common)); } } @@ -1230,7 +1531,9 @@ pars_elsif_element( { elsif_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(elsif_node_t)); + node = static_cast<elsif_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(elsif_node_t))); node->common.type = QUE_NODE_ELSIF; @@ -1258,7 +1561,9 @@ pars_if_statement( if_node_t* node; elsif_node_t* elsif_node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(if_node_t)); + node = static_cast<if_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(if_node_t))); node->common.type = QUE_NODE_IF; @@ -1273,14 +1578,15 @@ pars_if_statement( /* There is a list of elsif conditions */ node->else_part = NULL; - node->elsif_list = else_part; + node->elsif_list = static_cast<elsif_node_t*>(else_part); - elsif_node = else_part; + elsif_node = static_cast<elsif_node_t*>(else_part); while (elsif_node) { pars_set_parent_in_list(elsif_node->stat_list, node); - elsif_node = que_node_get_next(elsif_node); + elsif_node = static_cast<elsif_node_t*>( + que_node_get_next(elsif_node)); } } else { node->else_part = else_part; @@ -1306,7 +1612,9 @@ pars_while_statement( { while_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(while_node_t)); + node = static_cast<while_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(while_node_t))); node->common.type = QUE_NODE_WHILE; @@ -1335,7 +1643,8 @@ pars_for_statement( { for_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(for_node_t)); + node = static_cast<for_node_t*>( + mem_heap_alloc(pars_sym_tab_global->heap, sizeof(for_node_t))); node->common.type = QUE_NODE_FOR; @@ -1367,7 +1676,8 @@ pars_exit_statement(void) { exit_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(exit_node_t)); + node = static_cast<exit_node_t*>( + mem_heap_alloc(pars_sym_tab_global->heap, sizeof(exit_node_t))); node->common.type = QUE_NODE_EXIT; return(node); @@ -1383,8 +1693,9 @@ pars_return_statement(void) { return_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, - sizeof(return_node_t)); + node = static_cast<return_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(return_node_t))); node->common.type = QUE_NODE_RETURN; return(node); @@ -1402,8 +1713,9 @@ pars_assignment_statement( { assign_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, - sizeof(assign_node_t)); + node = static_cast<assign_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(assign_node_t))); node->common.type = QUE_NODE_ASSIGNMENT; node->var = var; @@ -1455,7 +1767,9 @@ pars_fetch_statement( /* Logical XOR. */ ut_a(!into_list != !user_func); - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(fetch_node_t)); + node = static_cast<fetch_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(fetch_node_t))); node->common.type = QUE_NODE_FETCH; @@ -1503,7 +1817,9 @@ pars_open_statement( sym_node_t* cursor_decl; open_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, sizeof(open_node_t)); + node = static_cast<open_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(open_node_t))); node->common.type = QUE_NODE_OPEN; @@ -1513,7 +1829,7 @@ pars_open_statement( ut_a(cursor_decl->token_type == SYM_CURSOR); - node->op_type = type; + node->op_type = static_cast<open_node_op>(type); node->cursor_def = cursor_decl->cursor_def; return(node); @@ -1530,8 +1846,9 @@ pars_row_printf_statement( { row_printf_node_t* node; - node = mem_heap_alloc(pars_sym_tab_global->heap, - sizeof(row_printf_node_t)); + node = static_cast<row_printf_node_t*>( + mem_heap_alloc( + pars_sym_tab_global->heap, sizeof(row_printf_node_t))); node->common.type = QUE_NODE_ROW_PRINTF; node->sel_node = sel_node; @@ -1549,7 +1866,7 @@ commit_node_t* pars_commit_statement(void) /*=======================*/ { - return(commit_node_create(pars_sym_tab_global->heap)); + return(trx_commit_node_create(pars_sym_tab_global->heap)); } /*********************************************************************//** @@ -1604,6 +1921,8 @@ pars_create_table( sym_node_t* table_sym, /*!< in: table name node in the symbol table */ sym_node_t* column_defs, /*!< in: list of column names */ + sym_node_t* compact, /* in: non-NULL if COMPACT table. */ + sym_node_t* block_size, /* in: block size (can be NULL) */ void* not_fit_in_memory __attribute__((unused))) /*!< in: a non-NULL pointer means that this is a table which in simulations @@ -1621,13 +1940,44 @@ pars_create_table( tab_node_t* node; const dtype_t* dtype; ulint n_cols; + ulint flags = 0; + + if (compact != NULL) { + flags |= DICT_TF_COMPACT; + } + + if (block_size != NULL) { + ulint size; + dfield_t* dfield; + + dfield = que_node_get_val(block_size); + + ut_a(dfield_get_len(dfield) == 4); + size = mach_read_from_4(static_cast<byte*>( + dfield_get_data(dfield))); + + + switch (size) { + case 0: + break; + + case 1: case 2: case 4: case 8: case 16: + flags |= DICT_TF_COMPACT; + /* FTS-FIXME: needs the zip changes */ + /* flags |= size << DICT_TF_COMPRESSED_SHIFT; */ + break; + + default: + ut_error; + } + } n_cols = que_node_list_get_len(column_defs); /* As the InnoDB SQL parser is for internal use only, for creating some system tables, this function will only create tables in the old (not compact) record format. */ - table = dict_mem_table_create(table_sym->name, 0, n_cols, 0); + table = dict_mem_table_create(table_sym->name, 0, n_cols, flags, 0); #ifdef UNIV_DEBUG if (not_fit_in_memory != NULL) { @@ -1645,7 +1995,7 @@ pars_create_table( column->resolved = TRUE; column->token_type = SYM_COLUMN; - column = que_node_get_next(column); + column = static_cast<sym_node_t*>(que_node_get_next(column)); } node = tab_create_graph_create(table, pars_sym_tab_global->heap); @@ -1699,7 +2049,7 @@ pars_create_index( column->resolved = TRUE; column->token_type = SYM_COLUMN; - column = que_node_get_next(column); + column = static_cast<sym_node_t*>(que_node_get_next(column)); } node = ind_create_graph_create(index, pars_sym_tab_global->heap); @@ -1737,7 +2087,8 @@ pars_procedure_definition( thr = que_thr_create(fork, heap); - node = mem_heap_alloc(heap, sizeof(proc_node_t)); + node = static_cast<proc_node_t*>( + mem_heap_alloc(heap, sizeof(proc_node_t))); node->common.type = QUE_NODE_PROC; node->common.parent = thr; @@ -1780,11 +2131,10 @@ pars_stored_procedure_call( /*************************************************************//** Retrieves characters to the lexical analyzer. */ UNIV_INTERN -void +int pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int* result, /*!< out: number of characters copied or EOF */ int max_size) /*!< in: maximum number of characters which fit in the buffer */ { @@ -1796,9 +2146,7 @@ pars_get_lex_chars( #ifdef YYDEBUG /* fputs("SQL string ends\n", stderr); */ #endif - *result = 0; - - return; + return(0); } if (len > max_size) { @@ -1820,9 +2168,10 @@ pars_get_lex_chars( ut_memcpy(buf, pars_sym_tab_global->sql_string + pars_sym_tab_global->next_char_pos, len); - *result = len; pars_sym_tab_global->next_char_pos += len; + + return(len); } /*************************************************************//** @@ -1865,8 +2214,8 @@ pars_sql( pars_sym_tab_global = sym_tab_create(heap); pars_sym_tab_global->string_len = strlen(str); - pars_sym_tab_global->sql_string = mem_heap_dup( - heap, str, pars_sym_tab_global->string_len + 1); + pars_sym_tab_global->sql_string = static_cast<char*>( + mem_heap_dup(heap, str, pars_sym_tab_global->string_len + 1)); pars_sym_tab_global->next_char_pos = 0; pars_sym_tab_global->info = info; @@ -1885,6 +2234,8 @@ pars_sql( graph->sym_tab = pars_sym_tab_global; graph->info = info; + pars_sym_tab_global = NULL; + /* fprintf(stderr, "SQL graph size %lu\n", mem_heap_get_size(heap)); */ return(graph); @@ -1934,7 +2285,7 @@ pars_info_create(void) heap = mem_heap_create(512); - info = mem_heap_alloc(heap, sizeof(*info)); + info = static_cast<pars_info_t*>(mem_heap_alloc(heap, sizeof(*info))); info->heap = heap; info->funcs = NULL; @@ -1974,16 +2325,22 @@ pars_info_add_literal( ut_ad(!pars_info_get_bound_lit(info, name)); - pbl = mem_heap_alloc(info->heap, sizeof(*pbl)); + pbl = static_cast<pars_bound_lit_t*>( + mem_heap_alloc(info->heap, sizeof(*pbl))); pbl->name = name; + pbl->address = address; pbl->length = length; pbl->type = type; pbl->prtype = prtype; if (!info->bound_lits) { - info->bound_lits = ib_vector_create(info->heap, 8); + ib_alloc_t* heap_alloc; + + heap_alloc = ib_heap_allocator_create(info->heap); + + info->bound_lits = ib_vector_create(heap_alloc, sizeof(*pbl), 8); } ib_vector_push(info->bound_lits, pbl); @@ -2004,6 +2361,63 @@ pars_info_add_str_literal( DATA_VARCHAR, DATA_ENGLISH); } +/******************************************************************** +If the literal value already exists then it rebinds otherwise it +creates a new entry.*/ +UNIV_INTERN +void +pars_info_bind_literal( +/*===================*/ + pars_info_t* info, /* in: info struct */ + const char* name, /* in: name */ + const void* address, /* in: address */ + ulint length, /* in: length of data */ + ulint type, /* in: type, e.g. DATA_FIXBINARY */ + ulint prtype) /* in: precise type, e.g. */ +{ + pars_bound_lit_t* pbl; + + pbl = pars_info_lookup_bound_lit(info, name); + + if (!pbl) { + pars_info_add_literal( + info, name, address, length, type, prtype); + } else { + pbl->address = address; + pbl->length = length; + + sym_tab_rebind_lit(pbl->node, address, length); + } +} + +/******************************************************************** +If the literal value already exists then it rebinds otherwise it +creates a new entry.*/ +UNIV_INTERN +void +pars_info_bind_varchar_literal( +/*===========================*/ + pars_info_t* info, /*!< in: info struct */ + const char* name, /*!< in: name */ + const byte* str, /*!< in: string */ + ulint str_len) /*!< in: string length */ +{ + pars_bound_lit_t* pbl; + + pbl = pars_info_lookup_bound_lit(info, name); + + if (!pbl) { + pars_info_add_literal( + info, name, str, str_len, DATA_VARCHAR, DATA_ENGLISH); + } else { + + pbl->address = str; + pbl->length = str_len; + + sym_tab_rebind_lit(pbl->node, str, str_len); + } +} + /****************************************************************//** Equivalent to: @@ -2021,12 +2435,65 @@ pars_info_add_int4_literal( const char* name, /*!< in: name */ lint val) /*!< in: value */ { - byte* buf = mem_heap_alloc(info->heap, 4); + byte* buf = static_cast<byte*>(mem_heap_alloc(info->heap, 4)); mach_write_to_4(buf, val); pars_info_add_literal(info, name, buf, 4, DATA_INT, 0); } +/******************************************************************** +If the literal value already exists then it rebinds otherwise it +creates a new entry. */ +UNIV_INTERN +void +pars_info_bind_int4_literal( +/*========================*/ + pars_info_t* info, /* in: info struct */ + const char* name, /* in: name */ + const ib_uint32_t* val) /* in: value */ +{ + pars_bound_lit_t* pbl; + + pbl = pars_info_lookup_bound_lit(info, name); + + if (!pbl) { + pars_info_add_literal(info, name, val, 4, DATA_INT, 0); + } else { + + pbl->address = val; + pbl->length = sizeof(*val); + + sym_tab_rebind_lit(pbl->node, val, sizeof(*val)); + } +} + +/******************************************************************** +If the literal value already exists then it rebinds otherwise it +creates a new entry. */ +UNIV_INTERN +void +pars_info_bind_int8_literal( +/*========================*/ + pars_info_t* info, /* in: info struct */ + const char* name, /* in: name */ + const ib_uint64_t* val) /* in: value */ +{ + pars_bound_lit_t* pbl; + + pbl = pars_info_lookup_bound_lit(info, name); + + if (!pbl) { + pars_info_add_literal( + info, name, val, sizeof(*val), DATA_INT, 0); + } else { + + pbl->address = val; + pbl->length = sizeof(*val); + + sym_tab_rebind_lit(pbl->node, val, sizeof(*val)); + } +} + /****************************************************************//** Equivalent to: @@ -2044,7 +2511,7 @@ pars_info_add_ull_literal( const char* name, /*!< in: name */ ib_uint64_t val) /*!< in: value */ { - byte* buf = mem_heap_alloc(info->heap, 8); + byte* buf = static_cast<byte*>(mem_heap_alloc(info->heap, 8)); mach_write_to_8(buf, val); @@ -2055,8 +2522,8 @@ pars_info_add_ull_literal( Add user function. */ UNIV_INTERN void -pars_info_add_function( -/*===================*/ +pars_info_bind_function( +/*====================*/ pars_info_t* info, /*!< in: info struct */ const char* name, /*!< in: function name */ pars_user_func_cb_t func, /*!< in: function address */ @@ -2064,45 +2531,77 @@ pars_info_add_function( { pars_user_func_t* puf; - ut_ad(!pars_info_get_user_func(info, name)); + puf = pars_info_lookup_user_func(info, name); - puf = mem_heap_alloc(info->heap, sizeof(*puf)); + if (!puf) { + if (!info->funcs) { + ib_alloc_t* heap_alloc; - puf->name = name; - puf->func = func; - puf->arg = arg; + heap_alloc = ib_heap_allocator_create(info->heap); + + info->funcs = ib_vector_create( + heap_alloc, sizeof(*puf), 8); + } - if (!info->funcs) { - info->funcs = ib_vector_create(info->heap, 8); + /* Create a "new" element */ + puf = static_cast<pars_user_func_t*>( + ib_vector_push(info->funcs, NULL)); + puf->name = name; } - ib_vector_push(info->funcs, puf); + puf->arg = arg; + puf->func = func; } -/****************************************************************//** +/******************************************************************** Add bound id. */ UNIV_INTERN void -pars_info_add_id( -/*=============*/ +pars_info_bind_id( +/*==============*/ pars_info_t* info, /*!< in: info struct */ + ibool copy_name, /* in: copy name if TRUE */ const char* name, /*!< in: name */ const char* id) /*!< in: id */ { pars_bound_id_t* bid; - ut_ad(!pars_info_get_bound_id(info, name)); + bid = pars_info_lookup_bound_id(info, name); - bid = mem_heap_alloc(info->heap, sizeof(*bid)); + if (!bid) { - bid->name = name; - bid->id = id; + if (!info->bound_ids) { + ib_alloc_t* heap_alloc; + + heap_alloc = ib_heap_allocator_create(info->heap); - if (!info->bound_ids) { - info->bound_ids = ib_vector_create(info->heap, 8); + info->bound_ids = ib_vector_create( + heap_alloc, sizeof(*bid), 8); + } + + /* Create a "new" element */ + bid = static_cast<pars_bound_id_t*>( + ib_vector_push(info->bound_ids, NULL)); + + bid->name = (copy_name) + ? mem_heap_strdup(info->heap, name) : name; } - ib_vector_push(info->bound_ids, bid); + bid->id = id; +} + +/******************************************************************** +Get bound identifier with the given name.*/ + +pars_bound_id_t* +pars_info_get_bound_id( +/*===================*/ + /* out: bound id, or NULL if not + found */ + pars_info_t* info, /* in: info struct */ + const char* name) /* in: bound id name to find */ +{ + return(pars_info_lookup_bound_id(info, name)); } /****************************************************************//** @@ -2115,24 +2614,7 @@ pars_info_get_user_func( pars_info_t* info, /*!< in: info struct */ const char* name) /*!< in: function name to find*/ { - ulint i; - ib_vector_t* vec; - - if (!info || !info->funcs) { - return(NULL); - } - - vec = info->funcs; - - for (i = 0; i < ib_vector_size(vec); i++) { - pars_user_func_t* puf = ib_vector_get(vec, i); - - if (strcmp(puf->name, name) == 0) { - return(puf); - } - } - - return(NULL); + return(pars_info_lookup_user_func(info, name)); } /****************************************************************//** @@ -2145,52 +2627,5 @@ pars_info_get_bound_lit( pars_info_t* info, /*!< in: info struct */ const char* name) /*!< in: bound literal name to find */ { - ulint i; - ib_vector_t* vec; - - if (!info || !info->bound_lits) { - return(NULL); - } - - vec = info->bound_lits; - - for (i = 0; i < ib_vector_size(vec); i++) { - pars_bound_lit_t* pbl = ib_vector_get(vec, i); - - if (strcmp(pbl->name, name) == 0) { - return(pbl); - } - } - - return(NULL); -} - -/****************************************************************//** -Get bound id with the given name. -@return bound id, or NULL if not found */ -UNIV_INTERN -pars_bound_id_t* -pars_info_get_bound_id( -/*===================*/ - pars_info_t* info, /*!< in: info struct */ - const char* name) /*!< in: bound id name to find */ -{ - ulint i; - ib_vector_t* vec; - - if (!info || !info->bound_ids) { - return(NULL); - } - - vec = info->bound_ids; - - for (i = 0; i < ib_vector_size(vec); i++) { - pars_bound_id_t* bid = ib_vector_get(vec, i); - - if (strcmp(bid->name, name) == 0) { - return(bid); - } - } - - return(NULL); + return(pars_info_lookup_bound_lit(info, name)); } diff --git a/storage/innobase/pars/pars0sym.c b/storage/innobase/pars/pars0sym.cc index b56350116bb..c71ad8a6b39 100644 --- a/storage/innobase/pars/pars0sym.c +++ b/storage/innobase/pars/pars0sym.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved. +Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -11,13 +11,13 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ /**************************************************//** -@file pars/pars0sym.c +@file pars/pars0sym.cc SQL parser symbol table Created 12/15/1997 Heikki Tuuri @@ -49,7 +49,8 @@ sym_tab_create( { sym_tab_t* sym_tab; - sym_tab = mem_heap_alloc(heap, sizeof(sym_tab_t)); + sym_tab = static_cast<sym_tab_t*>( + mem_heap_alloc(heap, sizeof(sym_tab_t))); UT_LIST_INIT(sym_tab->sym_list); UT_LIST_INIT(sym_tab->func_node_list); @@ -59,6 +60,7 @@ sym_tab_create( return(sym_tab); } + /******************************************************************//** Frees the memory allocated dynamically AFTER parsing phase for variables etc. in the symbol table. Does not free the mem heap where the table was @@ -72,9 +74,23 @@ sym_tab_free_private( sym_node_t* sym; func_node_t* func; - sym = UT_LIST_GET_FIRST(sym_tab->sym_list); + ut_ad(mutex_own(&dict_sys->mutex)); + + for (sym = UT_LIST_GET_FIRST(sym_tab->sym_list); + sym != NULL; + sym = UT_LIST_GET_NEXT(sym_list, sym)) { + + /* Close the tables opened in pars_retrieve_table_def(). */ + + if (sym->token_type == SYM_TABLE_REF_COUNTED) { + + dict_table_close(sym->table, TRUE); + + sym->table = NULL; + sym->resolved = FALSE; + sym->token_type = SYM_UNSET; + } - while (sym) { eval_node_free_val_buf(sym); if (sym->prefetch_buf) { @@ -84,16 +100,13 @@ sym_tab_free_private( if (sym->cursor_def) { que_graph_free_recursive(sym->cursor_def); } - - sym = UT_LIST_GET_NEXT(sym_list, sym); } - func = UT_LIST_GET_FIRST(sym_tab->func_node_list); + for (func = UT_LIST_GET_FIRST(sym_tab->func_node_list); + func != NULL; + func = UT_LIST_GET_NEXT(func_node_list, func)) { - while (func) { eval_node_free_val_buf(func); - - func = UT_LIST_GET_NEXT(func_node_list, func); } } @@ -110,10 +123,12 @@ sym_tab_add_int_lit( sym_node_t* node; byte* data; - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t))); node->common.type = QUE_NODE_SYMBOL; + node->table = NULL; node->resolved = TRUE; node->token_type = SYM_LIT; @@ -121,7 +136,7 @@ sym_tab_add_int_lit( dtype_set(dfield_get_type(&node->common.val), DATA_INT, 0, 4); - data = mem_heap_alloc(sym_tab->heap, 4); + data = static_cast<byte*>(mem_heap_alloc(sym_tab->heap, 4)); mach_write_to_4(data, val); dfield_set_data(&(node->common.val), data, 4); @@ -132,6 +147,8 @@ sym_tab_add_int_lit( UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); + node->like_node = NULL; + node->sym_table = sym_tab; return(node); @@ -145,17 +162,19 @@ sym_node_t* sym_tab_add_str_lit( /*================*/ sym_tab_t* sym_tab, /*!< in: symbol table */ - byte* str, /*!< in: string with no quotes around + const byte* str, /*!< in: string with no quotes around it */ ulint len) /*!< in: string length */ { sym_node_t* node; byte* data; - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t))); node->common.type = QUE_NODE_SYMBOL; + node->table = NULL; node->resolved = TRUE; node->token_type = SYM_LIT; @@ -164,12 +183,8 @@ sym_tab_add_str_lit( dtype_set(dfield_get_type(&node->common.val), DATA_VARCHAR, DATA_ENGLISH, 0); - if (len) { - data = mem_heap_alloc(sym_tab->heap, len); - ut_memcpy(data, str, len); - } else { - data = NULL; - } + data = (len) ? static_cast<byte*>(mem_heap_dup(sym_tab->heap, str, len)) + : NULL; dfield_set_data(&(node->common.val), data, len); @@ -179,6 +194,8 @@ sym_tab_add_str_lit( UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); + node->like_node = NULL; + node->sym_table = sym_tab; return(node); @@ -202,10 +219,13 @@ sym_tab_add_bound_lit( blit = pars_info_get_bound_lit(sym_tab->info, name); ut_a(blit); - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t))); node->common.type = QUE_NODE_SYMBOL; + node->common.brother = node->common.parent = NULL; + node->table = NULL; node->resolved = TRUE; node->token_type = SYM_LIT; @@ -255,11 +275,57 @@ sym_tab_add_bound_lit( UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); + blit->node = node; + node->like_node = NULL; node->sym_table = sym_tab; return(node); } +/********************************************************************** +Rebind literal to a node in the symbol table. */ + +sym_node_t* +sym_tab_rebind_lit( +/*===============*/ + /* out: symbol table node */ + sym_node_t* node, /* in: node that is bound to literal*/ + const void* address, /* in: pointer to data */ + ulint length) /* in: length of data */ +{ + dfield_t* dfield = que_node_get_val(node); + dtype_t* dtype = dfield_get_type(dfield); + + ut_a(node->token_type == SYM_LIT); + + dfield_set_data(&node->common.val, address, length); + + if (node->like_node) { + + ut_a(dtype_get_mtype(dtype) == DATA_CHAR + || dtype_get_mtype(dtype) == DATA_VARCHAR); + + /* Don't force [FALSE] creation of sub-nodes (for LIKE) */ + pars_like_rebind( + node,static_cast<const byte*>(address), length); + } + + /* FIXME: What's this ? */ + node->common.val_buf_size = 0; + + if (node->prefetch_buf) { + sel_col_prefetch_buf_free(node->prefetch_buf); + node->prefetch_buf = NULL; + } + + if (node->cursor_def) { + que_graph_free_recursive(node->cursor_def); + node->cursor_def = NULL; + } + + return(node); +} + /******************************************************************//** Adds an SQL null literal to a symbol table. @return symbol table node */ @@ -271,10 +337,12 @@ sym_tab_add_null_lit( { sym_node_t* node; - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t))); node->common.type = QUE_NODE_SYMBOL; + node->table = NULL; node->resolved = TRUE; node->token_type = SYM_LIT; @@ -290,6 +358,8 @@ sym_tab_add_null_lit( UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node); + node->like_node = NULL; + node->sym_table = sym_tab; return(node); @@ -308,13 +378,11 @@ sym_tab_add_id( { sym_node_t* node; - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_zalloc(sym_tab->heap, sizeof(*node))); node->common.type = QUE_NODE_SYMBOL; - node->resolved = FALSE; - node->indirection = NULL; - node->name = mem_heap_strdupl(sym_tab->heap, (char*) name, len); node->name_len = len; @@ -322,10 +390,6 @@ sym_tab_add_id( dfield_set_null(&node->common.val); - node->common.val_buf_size = 0; - node->prefetch_buf = NULL; - node->cursor_def = NULL; - node->sym_table = sym_tab; return(node); @@ -337,7 +401,7 @@ Add a bound identifier to a symbol table. UNIV_INTERN sym_node_t* sym_tab_add_bound_id( -/*===========*/ +/*=================*/ sym_tab_t* sym_tab, /*!< in: symbol table */ const char* name) /*!< in: name of bound id */ { @@ -347,11 +411,14 @@ sym_tab_add_bound_id( bid = pars_info_get_bound_id(sym_tab->info, name); ut_a(bid); - node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t)); + node = static_cast<sym_node_t*>( + mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t))); node->common.type = QUE_NODE_SYMBOL; + node->table = NULL; node->resolved = FALSE; + node->token_type = SYM_UNSET; node->indirection = NULL; node->name = mem_heap_strdup(sym_tab->heap, bid->id); @@ -365,6 +432,8 @@ sym_tab_add_bound_id( node->prefetch_buf = NULL; node->cursor_def = NULL; + node->like_node = NULL; + node->sym_table = sym_tab; return(node); |