GRASS Programmer's Manual
6.4.2(2012)
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Bison implementation for Yacc-like parsers in C 00004 00005 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C LALR(1) parser skeleton written by Richard Stallman, by 00034 simplifying the original so-called "semantic" parser. */ 00035 00036 /* All symbols defined below should begin with yy or YY, to avoid 00037 infringing on user name space. This should be done even for local 00038 variables, as they might otherwise be expanded by user macros. 00039 There are some unavoidable exceptions within include files to 00040 define necessary library symbols; they are noted "INFRINGES ON 00041 USER NAME SPACE" below. */ 00042 00043 /* Identify Bison output. */ 00044 #define YYBISON 1 00045 00046 /* Bison version. */ 00047 #define YYBISON_VERSION "2.5" 00048 00049 /* Skeleton name. */ 00050 #define YYSKELETON_NAME "yacc.c" 00051 00052 /* Pure parsers. */ 00053 #define YYPURE 0 00054 00055 /* Push parsers. */ 00056 #define YYPUSH 0 00057 00058 /* Pull parsers. */ 00059 #define YYPULL 1 00060 00061 /* Using locations. */ 00062 #define YYLSP_NEEDED 0 00063 00064 00065 00066 /* Copy the first part of user declarations. */ 00067 00068 /* Line 268 of yacc.c */ 00069 #line 21 "yac.y" 00070 00071 #include <stdlib.h> 00072 #include <string.h> 00073 #include <math.h> 00074 #include <grass/sqlp.h> 00075 00076 #define YYDEBUG 1 00077 #define YYERROR_VERBOSE 1 00078 00079 00080 00081 /* Line 268 of yacc.c */ 00082 #line 83 "y.tab.c" 00083 00084 /* Enabling traces. */ 00085 #ifndef YYDEBUG 00086 # define YYDEBUG 0 00087 #endif 00088 00089 /* Enabling verbose error messages. */ 00090 #ifdef YYERROR_VERBOSE 00091 # undef YYERROR_VERBOSE 00092 # define YYERROR_VERBOSE 1 00093 #else 00094 # define YYERROR_VERBOSE 0 00095 #endif 00096 00097 /* Enabling the token table. */ 00098 #ifndef YYTOKEN_TABLE 00099 # define YYTOKEN_TABLE 0 00100 #endif 00101 00102 00103 /* Tokens. */ 00104 #ifndef YYTOKENTYPE 00105 # define YYTOKENTYPE 00106 /* Put the tokens into the symbol table, so that GDB and other debuggers 00107 know about them. */ 00108 enum yytokentype { 00109 COMPARISON_OPERATOR = 258, 00110 NAME = 259, 00111 STRING = 260, 00112 INTNUM = 261, 00113 FLOATNUM = 262, 00114 ADD = 263, 00115 DROP = 264, 00116 COLUMN = 265, 00117 EQUAL = 266, 00118 SELECT = 267, 00119 FROM = 268, 00120 WHERE = 269, 00121 DELETE = 270, 00122 INSERT = 271, 00123 INTO = 272, 00124 VALUES = 273, 00125 UPDATE = 274, 00126 SET = 275, 00127 AND = 276, 00128 OR = 277, 00129 NOT = 278, 00130 ALTER = 279, 00131 TABLE = 280, 00132 CREATE = 281, 00133 NULL_VALUE = 282, 00134 VARCHAR = 283, 00135 INT = 284, 00136 INTEGER = 285, 00137 DOUBLE = 286, 00138 PRECISION = 287, 00139 DATE = 288, 00140 TIME = 289, 00141 ORDER = 290, 00142 BY = 291, 00143 IS = 292, 00144 ASC = 293, 00145 DESC = 294 00146 }; 00147 #endif 00148 /* Tokens. */ 00149 #define COMPARISON_OPERATOR 258 00150 #define NAME 259 00151 #define STRING 260 00152 #define INTNUM 261 00153 #define FLOATNUM 262 00154 #define ADD 263 00155 #define DROP 264 00156 #define COLUMN 265 00157 #define EQUAL 266 00158 #define SELECT 267 00159 #define FROM 268 00160 #define WHERE 269 00161 #define DELETE 270 00162 #define INSERT 271 00163 #define INTO 272 00164 #define VALUES 273 00165 #define UPDATE 274 00166 #define SET 275 00167 #define AND 276 00168 #define OR 277 00169 #define NOT 278 00170 #define ALTER 279 00171 #define TABLE 280 00172 #define CREATE 281 00173 #define NULL_VALUE 282 00174 #define VARCHAR 283 00175 #define INT 284 00176 #define INTEGER 285 00177 #define DOUBLE 286 00178 #define PRECISION 287 00179 #define DATE 288 00180 #define TIME 289 00181 #define ORDER 290 00182 #define BY 291 00183 #define IS 292 00184 #define ASC 293 00185 #define DESC 294 00186 00187 00188 00189 00190 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00191 typedef union YYSTYPE 00192 { 00193 00194 /* Line 293 of yacc.c */ 00195 #line 34 "yac.y" 00196 00197 int intval; 00198 double floatval; 00199 char *strval; 00200 int subtok; 00201 SQLPNODE *node; 00202 00203 00204 00205 /* Line 293 of yacc.c */ 00206 #line 207 "y.tab.c" 00207 } YYSTYPE; 00208 # define YYSTYPE_IS_TRIVIAL 1 00209 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00210 # define YYSTYPE_IS_DECLARED 1 00211 #endif 00212 00213 00214 /* Copy the second part of user declarations. */ 00215 00216 /* Line 343 of yacc.c */ 00217 #line 88 "yac.y" 00218 00219 00220 extern int yylex(void); 00221 00222 00223 00224 /* Line 343 of yacc.c */ 00225 #line 226 "y.tab.c" 00226 00227 #ifdef short 00228 # undef short 00229 #endif 00230 00231 #ifdef YYTYPE_UINT8 00232 typedef YYTYPE_UINT8 yytype_uint8; 00233 #else 00234 typedef unsigned char yytype_uint8; 00235 #endif 00236 00237 #ifdef YYTYPE_INT8 00238 typedef YYTYPE_INT8 yytype_int8; 00239 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00240 || defined __cplusplus || defined _MSC_VER) 00241 typedef signed char yytype_int8; 00242 #else 00243 typedef short int yytype_int8; 00244 #endif 00245 00246 #ifdef YYTYPE_UINT16 00247 typedef YYTYPE_UINT16 yytype_uint16; 00248 #else 00249 typedef unsigned short int yytype_uint16; 00250 #endif 00251 00252 #ifdef YYTYPE_INT16 00253 typedef YYTYPE_INT16 yytype_int16; 00254 #else 00255 typedef short int yytype_int16; 00256 #endif 00257 00258 #ifndef YYSIZE_T 00259 # ifdef __SIZE_TYPE__ 00260 # define YYSIZE_T __SIZE_TYPE__ 00261 # elif defined size_t 00262 # define YYSIZE_T size_t 00263 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00264 || defined __cplusplus || defined _MSC_VER) 00265 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00266 # define YYSIZE_T size_t 00267 # else 00268 # define YYSIZE_T unsigned int 00269 # endif 00270 #endif 00271 00272 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00273 00274 #ifndef YY_ 00275 # if defined YYENABLE_NLS && YYENABLE_NLS 00276 # if ENABLE_NLS 00277 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00278 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00279 # endif 00280 # endif 00281 # ifndef YY_ 00282 # define YY_(msgid) msgid 00283 # endif 00284 #endif 00285 00286 /* Suppress unused-variable warnings by "using" E. */ 00287 #if ! defined lint || defined __GNUC__ 00288 # define YYUSE(e) ((void) (e)) 00289 #else 00290 # define YYUSE(e) /* empty */ 00291 #endif 00292 00293 /* Identity function, used to suppress warnings about constant conditions. */ 00294 #ifndef lint 00295 # define YYID(n) (n) 00296 #else 00297 #if (defined __STDC__ || defined __C99__FUNC__ \ 00298 || defined __cplusplus || defined _MSC_VER) 00299 static int 00300 YYID (int yyi) 00301 #else 00302 static int 00303 YYID (yyi) 00304 int yyi; 00305 #endif 00306 { 00307 return yyi; 00308 } 00309 #endif 00310 00311 #if ! defined yyoverflow || YYERROR_VERBOSE 00312 00313 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00314 00315 # ifdef YYSTACK_USE_ALLOCA 00316 # if YYSTACK_USE_ALLOCA 00317 # ifdef __GNUC__ 00318 # define YYSTACK_ALLOC __builtin_alloca 00319 # elif defined __BUILTIN_VA_ARG_INCR 00320 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00321 # elif defined _AIX 00322 # define YYSTACK_ALLOC __alloca 00323 # elif defined _MSC_VER 00324 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 00325 # define alloca _alloca 00326 # else 00327 # define YYSTACK_ALLOC alloca 00328 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00329 || defined __cplusplus || defined _MSC_VER) 00330 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00331 # ifndef EXIT_SUCCESS 00332 # define EXIT_SUCCESS 0 00333 # endif 00334 # endif 00335 # endif 00336 # endif 00337 # endif 00338 00339 # ifdef YYSTACK_ALLOC 00340 /* Pacify GCC's `empty if-body' warning. */ 00341 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00342 # ifndef YYSTACK_ALLOC_MAXIMUM 00343 /* The OS might guarantee only one guard page at the bottom of the stack, 00344 and a page size can be as small as 4096 bytes. So we cannot safely 00345 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00346 to allow for a few compiler-allocated temporary stack slots. */ 00347 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00348 # endif 00349 # else 00350 # define YYSTACK_ALLOC YYMALLOC 00351 # define YYSTACK_FREE YYFREE 00352 # ifndef YYSTACK_ALLOC_MAXIMUM 00353 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00354 # endif 00355 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00356 && ! ((defined YYMALLOC || defined malloc) \ 00357 && (defined YYFREE || defined free))) 00358 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00359 # ifndef EXIT_SUCCESS 00360 # define EXIT_SUCCESS 0 00361 # endif 00362 # endif 00363 # ifndef YYMALLOC 00364 # define YYMALLOC malloc 00365 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00366 || defined __cplusplus || defined _MSC_VER) 00367 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 00368 # endif 00369 # endif 00370 # ifndef YYFREE 00371 # define YYFREE free 00372 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00373 || defined __cplusplus || defined _MSC_VER) 00374 void free (void *); /* INFRINGES ON USER NAME SPACE */ 00375 # endif 00376 # endif 00377 # endif 00378 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 00379 00380 00381 #if (! defined yyoverflow \ 00382 && (! defined __cplusplus \ 00383 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 00384 00385 /* A type that is properly aligned for any stack member. */ 00386 union yyalloc 00387 { 00388 yytype_int16 yyss_alloc; 00389 YYSTYPE yyvs_alloc; 00390 }; 00391 00392 /* The size of the maximum gap between one aligned stack and the next. */ 00393 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 00394 00395 /* The size of an array large to enough to hold all stacks, each with 00396 N elements. */ 00397 # define YYSTACK_BYTES(N) \ 00398 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 00399 + YYSTACK_GAP_MAXIMUM) 00400 00401 # define YYCOPY_NEEDED 1 00402 00403 /* Relocate STACK from its old location to the new one. The 00404 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00405 elements in the stack, and YYPTR gives the new location of the 00406 stack. Advance YYPTR to a properly aligned location for the next 00407 stack. */ 00408 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 00409 do \ 00410 { \ 00411 YYSIZE_T yynewbytes; \ 00412 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 00413 Stack = &yyptr->Stack_alloc; \ 00414 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 00415 yyptr += yynewbytes / sizeof (*yyptr); \ 00416 } \ 00417 while (YYID (0)) 00418 00419 #endif 00420 00421 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 00422 /* Copy COUNT objects from FROM to TO. The source and destination do 00423 not overlap. */ 00424 # ifndef YYCOPY 00425 # if defined __GNUC__ && 1 < __GNUC__ 00426 # define YYCOPY(To, From, Count) \ 00427 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00428 # else 00429 # define YYCOPY(To, From, Count) \ 00430 do \ 00431 { \ 00432 YYSIZE_T yyi; \ 00433 for (yyi = 0; yyi < (Count); yyi++) \ 00434 (To)[yyi] = (From)[yyi]; \ 00435 } \ 00436 while (YYID (0)) 00437 # endif 00438 # endif 00439 #endif /* !YYCOPY_NEEDED */ 00440 00441 /* YYFINAL -- State number of the termination state. */ 00442 #define YYFINAL 27 00443 /* YYLAST -- Last index in YYTABLE. */ 00444 #define YYLAST 156 00445 00446 /* YYNTOKENS -- Number of terminals. */ 00447 #define YYNTOKENS 48 00448 /* YYNNTS -- Number of nonterminals. */ 00449 #define YYNNTS 32 00450 /* YYNRULES -- Number of rules. */ 00451 #define YYNRULES 87 00452 /* YYNRULES -- Number of states. */ 00453 #define YYNSTATES 157 00454 00455 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00456 #define YYUNDEFTOK 2 00457 #define YYMAXUTOK 294 00458 00459 #define YYTRANSLATE(YYX) \ 00460 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 00461 00462 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00463 static const yytype_uint8 yytranslate[] = 00464 { 00465 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00469 41, 42, 44, 46, 43, 45, 2, 47, 2, 2, 00470 2, 2, 2, 2, 2, 2, 2, 2, 2, 40, 00471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00490 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00491 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 00492 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 00493 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 00494 35, 36, 37, 38, 39 00495 }; 00496 00497 #if YYDEBUG 00498 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00499 YYRHS. */ 00500 static const yytype_uint16 yyprhs[] = 00501 { 00502 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 00503 20, 27, 33, 40, 47, 51, 56, 63, 71, 81, 00504 85, 91, 96, 104, 109, 116, 118, 122, 128, 131, 00505 134, 137, 141, 144, 147, 149, 151, 153, 157, 159, 00506 164, 166, 168, 170, 173, 175, 178, 182, 186, 190, 00507 195, 199, 204, 206, 210, 214, 218, 220, 222, 226, 00508 228, 232, 234, 238, 241, 245, 249, 253, 257, 259, 00509 263, 267, 269, 273, 277, 279, 282, 284, 286, 290, 00510 292, 294, 296, 298, 300, 302, 304, 307 00511 }; 00512 00513 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00514 static const yytype_int8 yyrhs[] = 00515 { 00516 49, 0, -1, 50, -1, 51, -1, 52, -1, 55, 00517 -1, 53, -1, 56, -1, 54, -1, 49, 40, -1, 00518 24, 25, 61, 8, 10, 58, -1, 24, 25, 61, 00519 8, 58, -1, 24, 25, 61, 9, 10, 4, -1, 00520 26, 25, 61, 41, 57, 42, -1, 9, 25, 61, 00521 -1, 12, 59, 13, 61, -1, 12, 59, 13, 61, 00522 14, 66, -1, 12, 59, 13, 61, 35, 36, 77, 00523 -1, 12, 59, 13, 61, 14, 66, 35, 36, 77, 00524 -1, 15, 13, 61, -1, 15, 13, 61, 14, 66, 00525 -1, 16, 17, 61, 62, -1, 16, 17, 61, 41, 00526 59, 42, 62, -1, 19, 61, 20, 64, -1, 19, 00527 61, 20, 64, 14, 66, -1, 58, -1, 57, 43, 00528 58, -1, 4, 28, 41, 6, 42, -1, 4, 29, 00529 -1, 4, 30, -1, 4, 31, -1, 4, 31, 32, 00530 -1, 4, 33, -1, 4, 34, -1, 44, -1, 60, 00531 -1, 4, -1, 60, 43, 4, -1, 4, -1, 18, 00532 41, 63, 42, -1, 27, -1, 5, -1, 6, -1, 00533 45, 6, -1, 7, -1, 45, 7, -1, 63, 43, 00534 27, -1, 63, 43, 5, -1, 63, 43, 6, -1, 00535 63, 43, 45, 6, -1, 63, 43, 7, -1, 63, 00536 43, 45, 7, -1, 65, -1, 64, 43, 65, -1, 00537 4, 11, 27, -1, 4, 11, 71, -1, 67, -1, 00538 68, -1, 67, 22, 68, -1, 69, -1, 68, 21, 00539 69, -1, 70, -1, 41, 67, 42, -1, 23, 69, 00540 -1, 71, 11, 71, -1, 71, 3, 71, -1, 71, 00541 37, 27, -1, 71, 23, 27, -1, 72, -1, 71, 00542 46, 72, -1, 71, 45, 72, -1, 73, -1, 72, 00543 44, 73, -1, 72, 47, 73, -1, 74, -1, 45, 00544 73, -1, 75, -1, 76, -1, 41, 71, 42, -1, 00545 5, -1, 6, -1, 7, -1, 4, -1, 78, -1, 00546 79, -1, 4, -1, 4, 38, -1, 4, 39, -1 00547 }; 00548 00549 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00550 static const yytype_uint16 yyrline[] = 00551 { 00552 0, 97, 97, 98, 99, 100, 101, 102, 103, 104, 00553 108, 109, 110, 114, 118, 122, 123, 124, 125, 129, 00554 130, 134, 135, 139, 140, 145, 146, 150, 151, 152, 00555 153, 154, 155, 156, 160, 161, 165, 166, 170, 174, 00556 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 00557 188, 189, 193, 194, 198, 202, 206, 213, 214, 218, 00558 219, 223, 224, 225, 230, 233, 236, 239, 246, 247, 00559 250, 256, 257, 260, 266, 267, 273, 274, 275, 280, 00560 281, 282, 287, 290, 290, 293, 294, 297 00561 }; 00562 #endif 00563 00564 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00565 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00566 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00567 static const char *const yytname[] = 00568 { 00569 "$end", "error", "$undefined", "COMPARISON_OPERATOR", "NAME", "STRING", 00570 "INTNUM", "FLOATNUM", "ADD", "DROP", "COLUMN", "EQUAL", "SELECT", "FROM", 00571 "WHERE", "DELETE", "INSERT", "INTO", "VALUES", "UPDATE", "SET", "AND", 00572 "OR", "NOT", "ALTER", "TABLE", "CREATE", "NULL_VALUE", "VARCHAR", "INT", 00573 "INTEGER", "DOUBLE", "PRECISION", "DATE", "TIME", "ORDER", "BY", "IS", 00574 "ASC", "DESC", "';'", "'('", "')'", "','", "'*'", "'-'", "'+'", "'/'", 00575 "$accept", "y_sql", "y_alter", "y_create", "y_drop", "y_select", 00576 "y_delete", "y_insert", "y_update", "y_columndefs", "y_columndef", 00577 "y_columns", "y_column_list", "y_table", "y_values", "y_value_list", 00578 "y_assignments", "y_assignment", "y_condition", "y_sub_condition", 00579 "y_sub_condition2", "y_boolean", "y_comparison", "y_expression", 00580 "y_product", "y_term", "y_atom", "y_value", "y_column", "y_order", 00581 "y_order_asc", "y_order_desc", 0 00582 }; 00583 #endif 00584 00585 # ifdef YYPRINT 00586 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00587 token YYLEX-NUM. */ 00588 static const yytype_uint16 yytoknum[] = 00589 { 00590 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 00591 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 00592 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 00593 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 00594 59, 40, 41, 44, 42, 45, 43, 47 00595 }; 00596 # endif 00597 00598 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00599 static const yytype_uint8 yyr1[] = 00600 { 00601 0, 48, 49, 49, 49, 49, 49, 49, 49, 49, 00602 50, 50, 50, 51, 52, 53, 53, 53, 53, 54, 00603 54, 55, 55, 56, 56, 57, 57, 58, 58, 58, 00604 58, 58, 58, 58, 59, 59, 60, 60, 61, 62, 00605 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 00606 63, 63, 64, 64, 65, 65, 66, 67, 67, 68, 00607 68, 69, 69, 69, 70, 70, 70, 70, 71, 71, 00608 71, 72, 72, 72, 73, 73, 74, 74, 74, 75, 00609 75, 75, 76, 77, 77, 78, 78, 79 00610 }; 00611 00612 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00613 static const yytype_uint8 yyr2[] = 00614 { 00615 0, 2, 1, 1, 1, 1, 1, 1, 1, 2, 00616 6, 5, 6, 6, 3, 4, 6, 7, 9, 3, 00617 5, 4, 7, 4, 6, 1, 3, 5, 2, 2, 00618 2, 3, 2, 2, 1, 1, 1, 3, 1, 4, 00619 1, 1, 1, 2, 1, 2, 3, 3, 3, 4, 00620 3, 4, 1, 3, 3, 3, 1, 1, 3, 1, 00621 3, 1, 3, 2, 3, 3, 3, 3, 1, 3, 00622 3, 1, 3, 3, 1, 2, 1, 1, 3, 1, 00623 1, 1, 1, 1, 1, 1, 2, 2 00624 }; 00625 00626 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 00627 Performed when YYTABLE doesn't specify something else to do. Zero 00628 means the default is an error. */ 00629 static const yytype_uint8 yydefact[] = 00630 { 00631 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 00632 3, 4, 6, 8, 5, 7, 0, 36, 34, 0, 00633 35, 0, 0, 38, 0, 0, 0, 1, 9, 14, 00634 0, 0, 19, 0, 0, 0, 0, 15, 37, 0, 00635 0, 0, 21, 0, 23, 52, 0, 0, 0, 0, 00636 0, 82, 79, 80, 81, 0, 0, 0, 20, 56, 00637 57, 59, 61, 0, 68, 71, 74, 76, 77, 0, 00638 0, 0, 0, 0, 0, 0, 11, 0, 0, 25, 00639 16, 0, 63, 0, 0, 0, 75, 0, 0, 0, 00640 0, 0, 0, 0, 0, 0, 0, 41, 42, 44, 00641 40, 0, 0, 0, 54, 55, 24, 53, 0, 28, 00642 29, 30, 32, 33, 10, 12, 13, 0, 0, 85, 00643 17, 83, 84, 62, 78, 0, 58, 60, 65, 64, 00644 67, 66, 70, 69, 72, 73, 43, 45, 39, 0, 00645 22, 0, 31, 26, 0, 86, 87, 47, 48, 50, 00646 46, 0, 0, 18, 49, 51, 27 00647 }; 00648 00649 /* YYDEFGOTO[NTERM-NUM]. */ 00650 static const yytype_int8 yydefgoto[] = 00651 { 00652 -1, 8, 9, 10, 11, 12, 13, 14, 15, 78, 00653 76, 19, 20, 24, 42, 102, 44, 45, 58, 59, 00654 60, 61, 62, 63, 64, 65, 66, 67, 68, 120, 00655 121, 122 00656 }; 00657 00658 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 00659 STATE-NUM. */ 00660 #define YYPACT_NINF -52 00661 static const yytype_int16 yypact[] = 00662 { 00663 64, -8, 3, 11, 5, 32, 49, 57, 2, -52, 00664 -52, -52, -52, -52, -52, -52, 32, -52, -52, 39, 00665 41, 32, 32, -52, 102, 32, 32, -52, -52, -52, 00666 32, 85, 109, 7, 95, 10, 83, 37, -52, 8, 00667 84, 3, -52, 115, -10, -52, 6, 117, 124, 8, 00668 93, -52, -52, -52, -52, 8, 8, 55, -52, 108, 00669 110, -52, -52, 0, 31, -52, -52, -52, -52, 23, 00670 90, 50, 8, 95, 79, 124, -52, 129, 24, -52, 00671 99, 131, -52, -16, -2, 55, -52, 8, 8, 55, 00672 55, 111, 113, 55, 55, 55, 55, -52, -52, -52, 00673 -52, 80, 51, 118, -52, 59, -52, -52, 96, -52, 00674 -52, 107, -52, -52, -52, -52, -52, 124, 105, 78, 00675 -52, -52, -52, -52, -52, 69, 110, -52, 59, 59, 00676 -52, -52, 31, 31, -52, -52, -52, -52, -52, 58, 00677 -52, 136, -52, -52, 131, -52, -52, -52, -52, -52, 00678 -52, 112, 101, -52, -52, -52, -52 00679 }; 00680 00681 /* YYPGOTO[NTERM-NUM]. */ 00682 static const yytype_int8 yypgoto[] = 00683 { 00684 -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, 00685 -48, 103, -52, 76, 42, -52, -52, 73, 9, 91, 00686 61, -47, -52, -51, 27, -25, -52, -52, -52, 12, 00687 -52, -52 00688 }; 00689 00690 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 00691 positive, shift that token. If negative, reduce the rule which 00692 number is the opposite. If YYTABLE_NINF, syntax error. */ 00693 #define YYTABLE_NINF -1 00694 static const yytype_uint8 yytable[] = 00695 { 00696 79, 89, 27, 89, 72, 84, 87, 17, 82, 90, 00697 74, 90, 51, 52, 53, 54, 75, 16, 46, 47, 00698 105, 91, 22, 91, 21, 40, 123, 114, 97, 98, 00699 99, 55, 86, 73, 125, 92, 23, 92, 128, 129, 00700 124, 127, 28, 93, 94, 93, 94, 18, 41, 56, 00701 100, 49, 30, 57, 51, 52, 53, 54, 80, 51, 00702 52, 53, 54, 147, 148, 149, 116, 117, 101, 143, 00703 134, 135, 50, 1, 25, 95, 2, 104, 96, 3, 00704 4, 106, 26, 5, 31, 150, 136, 137, 6, 38, 00705 7, 85, 29, 138, 139, 57, 85, 32, 33, 43, 00706 57, 35, 36, 151, 93, 94, 37, 108, 109, 110, 00707 111, 124, 112, 113, 93, 94, 145, 146, 154, 155, 00708 132, 133, 34, 39, 48, 69, 71, 77, 74, 81, 00709 87, 88, 103, 115, 118, 119, 40, 141, 130, 142, 00710 131, 144, 152, 156, 70, 140, 107, 83, 126, 0, 00711 0, 0, 0, 0, 0, 0, 153 00712 }; 00713 00714 #define yypact_value_is_default(yystate) \ 00715 ((yystate) == (-52)) 00716 00717 #define yytable_value_is_error(yytable_value) \ 00718 YYID (0) 00719 00720 static const yytype_int16 yycheck[] = 00721 { 00722 48, 3, 0, 3, 14, 56, 22, 4, 55, 11, 00723 4, 11, 4, 5, 6, 7, 10, 25, 8, 9, 00724 71, 23, 17, 23, 13, 18, 42, 75, 5, 6, 00725 7, 23, 57, 43, 85, 37, 4, 37, 89, 90, 00726 42, 88, 40, 45, 46, 45, 46, 44, 41, 41, 00727 27, 14, 13, 45, 4, 5, 6, 7, 49, 4, 00728 5, 6, 7, 5, 6, 7, 42, 43, 45, 117, 00729 95, 96, 35, 9, 25, 44, 12, 27, 47, 15, 00730 16, 72, 25, 19, 43, 27, 6, 7, 24, 4, 00731 26, 41, 16, 42, 43, 45, 41, 21, 22, 4, 00732 45, 25, 26, 45, 45, 46, 30, 28, 29, 30, 00733 31, 42, 33, 34, 45, 46, 38, 39, 6, 7, 00734 93, 94, 20, 14, 41, 41, 11, 10, 4, 36, 00735 22, 21, 42, 4, 35, 4, 18, 41, 27, 32, 00736 27, 36, 6, 42, 41, 103, 73, 56, 87, -1, 00737 -1, -1, -1, -1, -1, -1, 144 00738 }; 00739 00740 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 00741 symbol of state STATE-NUM. */ 00742 static const yytype_uint8 yystos[] = 00743 { 00744 0, 9, 12, 15, 16, 19, 24, 26, 49, 50, 00745 51, 52, 53, 54, 55, 56, 25, 4, 44, 59, 00746 60, 13, 17, 4, 61, 25, 25, 0, 40, 61, 00747 13, 43, 61, 61, 20, 61, 61, 61, 4, 14, 00748 18, 41, 62, 4, 64, 65, 8, 9, 41, 14, 00749 35, 4, 5, 6, 7, 23, 41, 45, 66, 67, 00750 68, 69, 70, 71, 72, 73, 74, 75, 76, 41, 00751 59, 11, 14, 43, 4, 10, 58, 10, 57, 58, 00752 66, 36, 69, 67, 71, 41, 73, 22, 21, 3, 00753 11, 23, 37, 45, 46, 44, 47, 5, 6, 7, 00754 27, 45, 63, 42, 27, 71, 66, 65, 28, 29, 00755 30, 31, 33, 34, 58, 4, 42, 43, 35, 4, 00756 77, 78, 79, 42, 42, 71, 68, 69, 71, 71, 00757 27, 27, 72, 72, 73, 73, 6, 7, 42, 43, 00758 62, 41, 32, 58, 36, 38, 39, 5, 6, 7, 00759 27, 45, 6, 77, 6, 7, 42 00760 }; 00761 00762 #define yyerrok (yyerrstatus = 0) 00763 #define yyclearin (yychar = YYEMPTY) 00764 #define YYEMPTY (-2) 00765 #define YYEOF 0 00766 00767 #define YYACCEPT goto yyacceptlab 00768 #define YYABORT goto yyabortlab 00769 #define YYERROR goto yyerrorlab 00770 00771 00772 /* Like YYERROR except do call yyerror. This remains here temporarily 00773 to ease the transition to the new meaning of YYERROR, for GCC. 00774 Once GCC version 2 has supplanted version 1, this can go. However, 00775 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 00776 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 00777 discussed. */ 00778 00779 #define YYFAIL goto yyerrlab 00780 #if defined YYFAIL 00781 /* This is here to suppress warnings from the GCC cpp's 00782 -Wunused-macros. Normally we don't worry about that warning, but 00783 some users do, and we want to make it easy for users to remove 00784 YYFAIL uses, which will produce warnings from Bison 2.5. */ 00785 #endif 00786 00787 #define YYRECOVERING() (!!yyerrstatus) 00788 00789 #define YYBACKUP(Token, Value) \ 00790 do \ 00791 if (yychar == YYEMPTY && yylen == 1) \ 00792 { \ 00793 yychar = (Token); \ 00794 yylval = (Value); \ 00795 YYPOPSTACK (1); \ 00796 goto yybackup; \ 00797 } \ 00798 else \ 00799 { \ 00800 yyerror (YY_("syntax error: cannot back up")); \ 00801 YYERROR; \ 00802 } \ 00803 while (YYID (0)) 00804 00805 00806 #define YYTERROR 1 00807 #define YYERRCODE 256 00808 00809 00810 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 00811 If N is 0, then set CURRENT to the empty location which ends 00812 the previous symbol: RHS[0] (always defined). */ 00813 00814 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 00815 #ifndef YYLLOC_DEFAULT 00816 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 00817 do \ 00818 if (YYID (N)) \ 00819 { \ 00820 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 00821 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 00822 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 00823 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 00824 } \ 00825 else \ 00826 { \ 00827 (Current).first_line = (Current).last_line = \ 00828 YYRHSLOC (Rhs, 0).last_line; \ 00829 (Current).first_column = (Current).last_column = \ 00830 YYRHSLOC (Rhs, 0).last_column; \ 00831 } \ 00832 while (YYID (0)) 00833 #endif 00834 00835 00836 /* This macro is provided for backward compatibility. */ 00837 00838 #ifndef YY_LOCATION_PRINT 00839 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 00840 #endif 00841 00842 00843 /* YYLEX -- calling `yylex' with the right arguments. */ 00844 00845 #ifdef YYLEX_PARAM 00846 # define YYLEX yylex (YYLEX_PARAM) 00847 #else 00848 # define YYLEX yylex () 00849 #endif 00850 00851 /* Enable debugging if requested. */ 00852 #if YYDEBUG 00853 00854 # ifndef YYFPRINTF 00855 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 00856 # define YYFPRINTF fprintf 00857 # endif 00858 00859 # define YYDPRINTF(Args) \ 00860 do { \ 00861 if (yydebug) \ 00862 YYFPRINTF Args; \ 00863 } while (YYID (0)) 00864 00865 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 00866 do { \ 00867 if (yydebug) \ 00868 { \ 00869 YYFPRINTF (stderr, "%s ", Title); \ 00870 yy_symbol_print (stderr, \ 00871 Type, Value); \ 00872 YYFPRINTF (stderr, "\n"); \ 00873 } \ 00874 } while (YYID (0)) 00875 00876 00877 /*--------------------------------. 00878 | Print this symbol on YYOUTPUT. | 00879 `--------------------------------*/ 00880 00881 /*ARGSUSED*/ 00882 #if (defined __STDC__ || defined __C99__FUNC__ \ 00883 || defined __cplusplus || defined _MSC_VER) 00884 static void 00885 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 00886 #else 00887 static void 00888 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 00889 FILE *yyoutput; 00890 int yytype; 00891 YYSTYPE const * const yyvaluep; 00892 #endif 00893 { 00894 if (!yyvaluep) 00895 return; 00896 # ifdef YYPRINT 00897 if (yytype < YYNTOKENS) 00898 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 00899 # else 00900 YYUSE (yyoutput); 00901 # endif 00902 switch (yytype) 00903 { 00904 default: 00905 break; 00906 } 00907 } 00908 00909 00910 /*--------------------------------. 00911 | Print this symbol on YYOUTPUT. | 00912 `--------------------------------*/ 00913 00914 #if (defined __STDC__ || defined __C99__FUNC__ \ 00915 || defined __cplusplus || defined _MSC_VER) 00916 static void 00917 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 00918 #else 00919 static void 00920 yy_symbol_print (yyoutput, yytype, yyvaluep) 00921 FILE *yyoutput; 00922 int yytype; 00923 YYSTYPE const * const yyvaluep; 00924 #endif 00925 { 00926 if (yytype < YYNTOKENS) 00927 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 00928 else 00929 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 00930 00931 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 00932 YYFPRINTF (yyoutput, ")"); 00933 } 00934 00935 /*------------------------------------------------------------------. 00936 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 00937 | TOP (included). | 00938 `------------------------------------------------------------------*/ 00939 00940 #if (defined __STDC__ || defined __C99__FUNC__ \ 00941 || defined __cplusplus || defined _MSC_VER) 00942 static void 00943 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 00944 #else 00945 static void 00946 yy_stack_print (yybottom, yytop) 00947 yytype_int16 *yybottom; 00948 yytype_int16 *yytop; 00949 #endif 00950 { 00951 YYFPRINTF (stderr, "Stack now"); 00952 for (; yybottom <= yytop; yybottom++) 00953 { 00954 int yybot = *yybottom; 00955 YYFPRINTF (stderr, " %d", yybot); 00956 } 00957 YYFPRINTF (stderr, "\n"); 00958 } 00959 00960 # define YY_STACK_PRINT(Bottom, Top) \ 00961 do { \ 00962 if (yydebug) \ 00963 yy_stack_print ((Bottom), (Top)); \ 00964 } while (YYID (0)) 00965 00966 00967 /*------------------------------------------------. 00968 | Report that the YYRULE is going to be reduced. | 00969 `------------------------------------------------*/ 00970 00971 #if (defined __STDC__ || defined __C99__FUNC__ \ 00972 || defined __cplusplus || defined _MSC_VER) 00973 static void 00974 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 00975 #else 00976 static void 00977 yy_reduce_print (yyvsp, yyrule) 00978 YYSTYPE *yyvsp; 00979 int yyrule; 00980 #endif 00981 { 00982 int yynrhs = yyr2[yyrule]; 00983 int yyi; 00984 unsigned long int yylno = yyrline[yyrule]; 00985 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 00986 yyrule - 1, yylno); 00987 /* The symbols being reduced. */ 00988 for (yyi = 0; yyi < yynrhs; yyi++) 00989 { 00990 YYFPRINTF (stderr, " $%d = ", yyi + 1); 00991 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 00992 &(yyvsp[(yyi + 1) - (yynrhs)]) 00993 ); 00994 YYFPRINTF (stderr, "\n"); 00995 } 00996 } 00997 00998 # define YY_REDUCE_PRINT(Rule) \ 00999 do { \ 01000 if (yydebug) \ 01001 yy_reduce_print (yyvsp, Rule); \ 01002 } while (YYID (0)) 01003 01004 /* Nonzero means print parse trace. It is left uninitialized so that 01005 multiple parsers can coexist. */ 01006 int yydebug; 01007 #else /* !YYDEBUG */ 01008 # define YYDPRINTF(Args) 01009 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 01010 # define YY_STACK_PRINT(Bottom, Top) 01011 # define YY_REDUCE_PRINT(Rule) 01012 #endif /* !YYDEBUG */ 01013 01014 01015 /* YYINITDEPTH -- initial size of the parser's stacks. */ 01016 #ifndef YYINITDEPTH 01017 # define YYINITDEPTH 200 01018 #endif 01019 01020 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 01021 if the built-in stack extension method is used). 01022 01023 Do not make this value too large; the results are undefined if 01024 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 01025 evaluated with infinite-precision integer arithmetic. */ 01026 01027 #ifndef YYMAXDEPTH 01028 # define YYMAXDEPTH 10000 01029 #endif 01030 01031 01032 #if YYERROR_VERBOSE 01033 01034 # ifndef yystrlen 01035 # if defined __GLIBC__ && defined _STRING_H 01036 # define yystrlen strlen 01037 # else 01038 /* Return the length of YYSTR. */ 01039 #if (defined __STDC__ || defined __C99__FUNC__ \ 01040 || defined __cplusplus || defined _MSC_VER) 01041 static YYSIZE_T 01042 yystrlen (const char *yystr) 01043 #else 01044 static YYSIZE_T 01045 yystrlen (yystr) 01046 const char *yystr; 01047 #endif 01048 { 01049 YYSIZE_T yylen; 01050 for (yylen = 0; yystr[yylen]; yylen++) 01051 continue; 01052 return yylen; 01053 } 01054 # endif 01055 # endif 01056 01057 # ifndef yystpcpy 01058 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 01059 # define yystpcpy stpcpy 01060 # else 01061 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01062 YYDEST. */ 01063 #if (defined __STDC__ || defined __C99__FUNC__ \ 01064 || defined __cplusplus || defined _MSC_VER) 01065 static char * 01066 yystpcpy (char *yydest, const char *yysrc) 01067 #else 01068 static char * 01069 yystpcpy (yydest, yysrc) 01070 char *yydest; 01071 const char *yysrc; 01072 #endif 01073 { 01074 char *yyd = yydest; 01075 const char *yys = yysrc; 01076 01077 while ((*yyd++ = *yys++) != '\0') 01078 continue; 01079 01080 return yyd - 1; 01081 } 01082 # endif 01083 # endif 01084 01085 # ifndef yytnamerr 01086 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 01087 quotes and backslashes, so that it's suitable for yyerror. The 01088 heuristic is that double-quoting is unnecessary unless the string 01089 contains an apostrophe, a comma, or backslash (other than 01090 backslash-backslash). YYSTR is taken from yytname. If YYRES is 01091 null, do not copy; instead, return the length of what the result 01092 would have been. */ 01093 static YYSIZE_T 01094 yytnamerr (char *yyres, const char *yystr) 01095 { 01096 if (*yystr == '"') 01097 { 01098 YYSIZE_T yyn = 0; 01099 char const *yyp = yystr; 01100 01101 for (;;) 01102 switch (*++yyp) 01103 { 01104 case '\'': 01105 case ',': 01106 goto do_not_strip_quotes; 01107 01108 case '\\': 01109 if (*++yyp != '\\') 01110 goto do_not_strip_quotes; 01111 /* Fall through. */ 01112 default: 01113 if (yyres) 01114 yyres[yyn] = *yyp; 01115 yyn++; 01116 break; 01117 01118 case '"': 01119 if (yyres) 01120 yyres[yyn] = '\0'; 01121 return yyn; 01122 } 01123 do_not_strip_quotes: ; 01124 } 01125 01126 if (! yyres) 01127 return yystrlen (yystr); 01128 01129 return yystpcpy (yyres, yystr) - yyres; 01130 } 01131 # endif 01132 01133 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 01134 about the unexpected token YYTOKEN for the state stack whose top is 01135 YYSSP. 01136 01137 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 01138 not large enough to hold the message. In that case, also set 01139 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 01140 required number of bytes is too large to store. */ 01141 static int 01142 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 01143 yytype_int16 *yyssp, int yytoken) 01144 { 01145 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 01146 YYSIZE_T yysize = yysize0; 01147 YYSIZE_T yysize1; 01148 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01149 /* Internationalized format string. */ 01150 const char *yyformat = 0; 01151 /* Arguments of yyformat. */ 01152 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01153 /* Number of reported tokens (one for the "unexpected", one per 01154 "expected"). */ 01155 int yycount = 0; 01156 01157 /* There are many possibilities here to consider: 01158 - Assume YYFAIL is not used. It's too flawed to consider. See 01159 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 01160 for details. YYERROR is fine as it does not invoke this 01161 function. 01162 - If this state is a consistent state with a default action, then 01163 the only way this function was invoked is if the default action 01164 is an error action. In that case, don't check for expected 01165 tokens because there are none. 01166 - The only way there can be no lookahead present (in yychar) is if 01167 this state is a consistent state with a default action. Thus, 01168 detecting the absence of a lookahead is sufficient to determine 01169 that there is no unexpected or expected token to report. In that 01170 case, just report a simple "syntax error". 01171 - Don't assume there isn't a lookahead just because this state is a 01172 consistent state with a default action. There might have been a 01173 previous inconsistent state, consistent state with a non-default 01174 action, or user semantic action that manipulated yychar. 01175 - Of course, the expected token list depends on states to have 01176 correct lookahead information, and it depends on the parser not 01177 to perform extra reductions after fetching a lookahead from the 01178 scanner and before detecting a syntax error. Thus, state merging 01179 (from LALR or IELR) and default reductions corrupt the expected 01180 token list. However, the list is correct for canonical LR with 01181 one exception: it will still contain any token that will not be 01182 accepted due to an error action in a later state. 01183 */ 01184 if (yytoken != YYEMPTY) 01185 { 01186 int yyn = yypact[*yyssp]; 01187 yyarg[yycount++] = yytname[yytoken]; 01188 if (!yypact_value_is_default (yyn)) 01189 { 01190 /* Start YYX at -YYN if negative to avoid negative indexes in 01191 YYCHECK. In other words, skip the first -YYN actions for 01192 this state because they are default actions. */ 01193 int yyxbegin = yyn < 0 ? -yyn : 0; 01194 /* Stay within bounds of both yycheck and yytname. */ 01195 int yychecklim = YYLAST - yyn + 1; 01196 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01197 int yyx; 01198 01199 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01200 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01201 && !yytable_value_is_error (yytable[yyx + yyn])) 01202 { 01203 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01204 { 01205 yycount = 1; 01206 yysize = yysize0; 01207 break; 01208 } 01209 yyarg[yycount++] = yytname[yyx]; 01210 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01211 if (! (yysize <= yysize1 01212 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01213 return 2; 01214 yysize = yysize1; 01215 } 01216 } 01217 } 01218 01219 switch (yycount) 01220 { 01221 # define YYCASE_(N, S) \ 01222 case N: \ 01223 yyformat = S; \ 01224 break 01225 YYCASE_(0, YY_("syntax error")); 01226 YYCASE_(1, YY_("syntax error, unexpected %s")); 01227 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 01228 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 01229 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 01230 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 01231 # undef YYCASE_ 01232 } 01233 01234 yysize1 = yysize + yystrlen (yyformat); 01235 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01236 return 2; 01237 yysize = yysize1; 01238 01239 if (*yymsg_alloc < yysize) 01240 { 01241 *yymsg_alloc = 2 * yysize; 01242 if (! (yysize <= *yymsg_alloc 01243 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 01244 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 01245 return 1; 01246 } 01247 01248 /* Avoid sprintf, as that infringes on the user's name space. 01249 Don't have undefined behavior even if the translation 01250 produced a string with the wrong number of "%s"s. */ 01251 { 01252 char *yyp = *yymsg; 01253 int yyi = 0; 01254 while ((*yyp = *yyformat) != '\0') 01255 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 01256 { 01257 yyp += yytnamerr (yyp, yyarg[yyi++]); 01258 yyformat += 2; 01259 } 01260 else 01261 { 01262 yyp++; 01263 yyformat++; 01264 } 01265 } 01266 return 0; 01267 } 01268 #endif /* YYERROR_VERBOSE */ 01269 01270 /*-----------------------------------------------. 01271 | Release the memory associated to this symbol. | 01272 `-----------------------------------------------*/ 01273 01274 /*ARGSUSED*/ 01275 #if (defined __STDC__ || defined __C99__FUNC__ \ 01276 || defined __cplusplus || defined _MSC_VER) 01277 static void 01278 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 01279 #else 01280 static void 01281 yydestruct (yymsg, yytype, yyvaluep) 01282 const char *yymsg; 01283 int yytype; 01284 YYSTYPE *yyvaluep; 01285 #endif 01286 { 01287 YYUSE (yyvaluep); 01288 01289 if (!yymsg) 01290 yymsg = "Deleting"; 01291 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 01292 01293 switch (yytype) 01294 { 01295 01296 default: 01297 break; 01298 } 01299 } 01300 01301 01302 /* Prevent warnings from -Wmissing-prototypes. */ 01303 #ifdef YYPARSE_PARAM 01304 #if defined __STDC__ || defined __cplusplus 01305 int yyparse (void *YYPARSE_PARAM); 01306 #else 01307 int yyparse (); 01308 #endif 01309 #else /* ! YYPARSE_PARAM */ 01310 #if defined __STDC__ || defined __cplusplus 01311 int yyparse (void); 01312 #else 01313 int yyparse (); 01314 #endif 01315 #endif /* ! YYPARSE_PARAM */ 01316 01317 01318 /* The lookahead symbol. */ 01319 int yychar; 01320 01321 /* The semantic value of the lookahead symbol. */ 01322 YYSTYPE yylval; 01323 01324 /* Number of syntax errors so far. */ 01325 int yynerrs; 01326 01327 01328 /*----------. 01329 | yyparse. | 01330 `----------*/ 01331 01332 #ifdef YYPARSE_PARAM 01333 #if (defined __STDC__ || defined __C99__FUNC__ \ 01334 || defined __cplusplus || defined _MSC_VER) 01335 int 01336 yyparse (void *YYPARSE_PARAM) 01337 #else 01338 int 01339 yyparse (YYPARSE_PARAM) 01340 void *YYPARSE_PARAM; 01341 #endif 01342 #else /* ! YYPARSE_PARAM */ 01343 #if (defined __STDC__ || defined __C99__FUNC__ \ 01344 || defined __cplusplus || defined _MSC_VER) 01345 int 01346 yyparse (void) 01347 #else 01348 int 01349 yyparse () 01350 01351 #endif 01352 #endif 01353 { 01354 int yystate; 01355 /* Number of tokens to shift before error messages enabled. */ 01356 int yyerrstatus; 01357 01358 /* The stacks and their tools: 01359 `yyss': related to states. 01360 `yyvs': related to semantic values. 01361 01362 Refer to the stacks thru separate pointers, to allow yyoverflow 01363 to reallocate them elsewhere. */ 01364 01365 /* The state stack. */ 01366 yytype_int16 yyssa[YYINITDEPTH]; 01367 yytype_int16 *yyss; 01368 yytype_int16 *yyssp; 01369 01370 /* The semantic value stack. */ 01371 YYSTYPE yyvsa[YYINITDEPTH]; 01372 YYSTYPE *yyvs; 01373 YYSTYPE *yyvsp; 01374 01375 YYSIZE_T yystacksize; 01376 01377 int yyn; 01378 int yyresult; 01379 /* Lookahead token as an internal (translated) token number. */ 01380 int yytoken; 01381 /* The variables used to return semantic value and location from the 01382 action routines. */ 01383 YYSTYPE yyval; 01384 01385 #if YYERROR_VERBOSE 01386 /* Buffer for error messages, and its allocated size. */ 01387 char yymsgbuf[128]; 01388 char *yymsg = yymsgbuf; 01389 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 01390 #endif 01391 01392 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 01393 01394 /* The number of symbols on the RHS of the reduced rule. 01395 Keep to zero when no symbol should be popped. */ 01396 int yylen = 0; 01397 01398 yytoken = 0; 01399 yyss = yyssa; 01400 yyvs = yyvsa; 01401 yystacksize = YYINITDEPTH; 01402 01403 YYDPRINTF ((stderr, "Starting parse\n")); 01404 01405 yystate = 0; 01406 yyerrstatus = 0; 01407 yynerrs = 0; 01408 yychar = YYEMPTY; /* Cause a token to be read. */ 01409 01410 /* Initialize stack pointers. 01411 Waste one element of value and location stack 01412 so that they stay on the same level as the state stack. 01413 The wasted elements are never initialized. */ 01414 yyssp = yyss; 01415 yyvsp = yyvs; 01416 01417 goto yysetstate; 01418 01419 /*------------------------------------------------------------. 01420 | yynewstate -- Push a new state, which is found in yystate. | 01421 `------------------------------------------------------------*/ 01422 yynewstate: 01423 /* In all cases, when you get here, the value and location stacks 01424 have just been pushed. So pushing a state here evens the stacks. */ 01425 yyssp++; 01426 01427 yysetstate: 01428 *yyssp = yystate; 01429 01430 if (yyss + yystacksize - 1 <= yyssp) 01431 { 01432 /* Get the current used size of the three stacks, in elements. */ 01433 YYSIZE_T yysize = yyssp - yyss + 1; 01434 01435 #ifdef yyoverflow 01436 { 01437 /* Give user a chance to reallocate the stack. Use copies of 01438 these so that the &'s don't force the real ones into 01439 memory. */ 01440 YYSTYPE *yyvs1 = yyvs; 01441 yytype_int16 *yyss1 = yyss; 01442 01443 /* Each stack pointer address is followed by the size of the 01444 data in use in that stack, in bytes. This used to be a 01445 conditional around just the two extra args, but that might 01446 be undefined if yyoverflow is a macro. */ 01447 yyoverflow (YY_("memory exhausted"), 01448 &yyss1, yysize * sizeof (*yyssp), 01449 &yyvs1, yysize * sizeof (*yyvsp), 01450 &yystacksize); 01451 01452 yyss = yyss1; 01453 yyvs = yyvs1; 01454 } 01455 #else /* no yyoverflow */ 01456 # ifndef YYSTACK_RELOCATE 01457 goto yyexhaustedlab; 01458 # else 01459 /* Extend the stack our own way. */ 01460 if (YYMAXDEPTH <= yystacksize) 01461 goto yyexhaustedlab; 01462 yystacksize *= 2; 01463 if (YYMAXDEPTH < yystacksize) 01464 yystacksize = YYMAXDEPTH; 01465 01466 { 01467 yytype_int16 *yyss1 = yyss; 01468 union yyalloc *yyptr = 01469 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 01470 if (! yyptr) 01471 goto yyexhaustedlab; 01472 YYSTACK_RELOCATE (yyss_alloc, yyss); 01473 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 01474 # undef YYSTACK_RELOCATE 01475 if (yyss1 != yyssa) 01476 YYSTACK_FREE (yyss1); 01477 } 01478 # endif 01479 #endif /* no yyoverflow */ 01480 01481 yyssp = yyss + yysize - 1; 01482 yyvsp = yyvs + yysize - 1; 01483 01484 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 01485 (unsigned long int) yystacksize)); 01486 01487 if (yyss + yystacksize - 1 <= yyssp) 01488 YYABORT; 01489 } 01490 01491 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 01492 01493 if (yystate == YYFINAL) 01494 YYACCEPT; 01495 01496 goto yybackup; 01497 01498 /*-----------. 01499 | yybackup. | 01500 `-----------*/ 01501 yybackup: 01502 01503 /* Do appropriate processing given the current state. Read a 01504 lookahead token if we need one and don't already have one. */ 01505 01506 /* First try to decide what to do without reference to lookahead token. */ 01507 yyn = yypact[yystate]; 01508 if (yypact_value_is_default (yyn)) 01509 goto yydefault; 01510 01511 /* Not known => get a lookahead token if don't already have one. */ 01512 01513 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 01514 if (yychar == YYEMPTY) 01515 { 01516 YYDPRINTF ((stderr, "Reading a token: ")); 01517 yychar = YYLEX; 01518 } 01519 01520 if (yychar <= YYEOF) 01521 { 01522 yychar = yytoken = YYEOF; 01523 YYDPRINTF ((stderr, "Now at end of input.\n")); 01524 } 01525 else 01526 { 01527 yytoken = YYTRANSLATE (yychar); 01528 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 01529 } 01530 01531 /* If the proper action on seeing token YYTOKEN is to reduce or to 01532 detect an error, take that action. */ 01533 yyn += yytoken; 01534 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 01535 goto yydefault; 01536 yyn = yytable[yyn]; 01537 if (yyn <= 0) 01538 { 01539 if (yytable_value_is_error (yyn)) 01540 goto yyerrlab; 01541 yyn = -yyn; 01542 goto yyreduce; 01543 } 01544 01545 /* Count tokens shifted since error; after three, turn off error 01546 status. */ 01547 if (yyerrstatus) 01548 yyerrstatus--; 01549 01550 /* Shift the lookahead token. */ 01551 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 01552 01553 /* Discard the shifted token. */ 01554 yychar = YYEMPTY; 01555 01556 yystate = yyn; 01557 *++yyvsp = yylval; 01558 01559 goto yynewstate; 01560 01561 01562 /*-----------------------------------------------------------. 01563 | yydefault -- do the default action for the current state. | 01564 `-----------------------------------------------------------*/ 01565 yydefault: 01566 yyn = yydefact[yystate]; 01567 if (yyn == 0) 01568 goto yyerrlab; 01569 goto yyreduce; 01570 01571 01572 /*-----------------------------. 01573 | yyreduce -- Do a reduction. | 01574 `-----------------------------*/ 01575 yyreduce: 01576 /* yyn is the number of a rule to reduce with. */ 01577 yylen = yyr2[yyn]; 01578 01579 /* If YYLEN is nonzero, implement the default value of the action: 01580 `$$ = $1'. 01581 01582 Otherwise, the following line sets YYVAL to garbage. 01583 This behavior is undocumented and Bison 01584 users should not rely upon it. Assigning to YYVAL 01585 unconditionally makes the parser a bit smaller, and it avoids a 01586 GCC warning that YYVAL may be used uninitialized. */ 01587 yyval = yyvsp[1-yylen]; 01588 01589 01590 YY_REDUCE_PRINT (yyn); 01591 switch (yyn) 01592 { 01593 case 10: 01594 01595 /* Line 1806 of yacc.c */ 01596 #line 108 "yac.y" 01597 { sqpCommand(SQLP_ADD_COLUMN); } 01598 break; 01599 01600 case 11: 01601 01602 /* Line 1806 of yacc.c */ 01603 #line 109 "yac.y" 01604 { sqpCommand(SQLP_ADD_COLUMN); } 01605 break; 01606 01607 case 12: 01608 01609 /* Line 1806 of yacc.c */ 01610 #line 110 "yac.y" 01611 { sqpCommand(SQLP_DROP_COLUMN); sqpColumn((yyvsp[(6) - (6)].strval));} 01612 break; 01613 01614 case 13: 01615 01616 /* Line 1806 of yacc.c */ 01617 #line 114 "yac.y" 01618 { sqpCommand(SQLP_CREATE); } 01619 break; 01620 01621 case 14: 01622 01623 /* Line 1806 of yacc.c */ 01624 #line 118 "yac.y" 01625 { sqpCommand(SQLP_DROP); } 01626 break; 01627 01628 case 15: 01629 01630 /* Line 1806 of yacc.c */ 01631 #line 122 "yac.y" 01632 { sqpCommand(SQLP_SELECT); } 01633 break; 01634 01635 case 16: 01636 01637 /* Line 1806 of yacc.c */ 01638 #line 123 "yac.y" 01639 { sqpCommand(SQLP_SELECT); } 01640 break; 01641 01642 case 17: 01643 01644 /* Line 1806 of yacc.c */ 01645 #line 124 "yac.y" 01646 { sqpCommand(SQLP_SELECT); } 01647 break; 01648 01649 case 18: 01650 01651 /* Line 1806 of yacc.c */ 01652 #line 125 "yac.y" 01653 { sqpCommand(SQLP_SELECT); } 01654 break; 01655 01656 case 19: 01657 01658 /* Line 1806 of yacc.c */ 01659 #line 129 "yac.y" 01660 { sqpCommand(SQLP_DELETE); } 01661 break; 01662 01663 case 20: 01664 01665 /* Line 1806 of yacc.c */ 01666 #line 130 "yac.y" 01667 { sqpCommand(SQLP_DELETE); } 01668 break; 01669 01670 case 21: 01671 01672 /* Line 1806 of yacc.c */ 01673 #line 134 "yac.y" 01674 { sqpCommand(SQLP_INSERT); } 01675 break; 01676 01677 case 22: 01678 01679 /* Line 1806 of yacc.c */ 01680 #line 135 "yac.y" 01681 { sqpCommand(SQLP_INSERT); } 01682 break; 01683 01684 case 23: 01685 01686 /* Line 1806 of yacc.c */ 01687 #line 139 "yac.y" 01688 { sqpCommand(SQLP_UPDATE); } 01689 break; 01690 01691 case 24: 01692 01693 /* Line 1806 of yacc.c */ 01694 #line 140 "yac.y" 01695 { sqpCommand(SQLP_UPDATE); } 01696 break; 01697 01698 case 27: 01699 01700 /* Line 1806 of yacc.c */ 01701 #line 150 "yac.y" 01702 { sqpColumnDef( (yyvsp[(1) - (5)].strval), SQLP_VARCHAR, (yyvsp[(4) - (5)].intval), 0 ); } 01703 break; 01704 01705 case 28: 01706 01707 /* Line 1806 of yacc.c */ 01708 #line 151 "yac.y" 01709 { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_INTEGER, 0, 0 ); } 01710 break; 01711 01712 case 29: 01713 01714 /* Line 1806 of yacc.c */ 01715 #line 152 "yac.y" 01716 { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_INTEGER, 0, 0 ); } 01717 break; 01718 01719 case 30: 01720 01721 /* Line 1806 of yacc.c */ 01722 #line 153 "yac.y" 01723 { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_DOUBLE, 0, 0 ); } 01724 break; 01725 01726 case 31: 01727 01728 /* Line 1806 of yacc.c */ 01729 #line 154 "yac.y" 01730 { sqpColumnDef( (yyvsp[(1) - (3)].strval), SQLP_DOUBLE, 0, 0 ); } 01731 break; 01732 01733 case 32: 01734 01735 /* Line 1806 of yacc.c */ 01736 #line 155 "yac.y" 01737 { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_DATE, 0, 0 ); } 01738 break; 01739 01740 case 33: 01741 01742 /* Line 1806 of yacc.c */ 01743 #line 156 "yac.y" 01744 { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_TIME, 0, 0 ); } 01745 break; 01746 01747 case 36: 01748 01749 /* Line 1806 of yacc.c */ 01750 #line 165 "yac.y" 01751 { sqpColumn( (yyvsp[(1) - (1)].strval) ); } 01752 break; 01753 01754 case 37: 01755 01756 /* Line 1806 of yacc.c */ 01757 #line 166 "yac.y" 01758 { sqpColumn( (yyvsp[(3) - (3)].strval) ); } 01759 break; 01760 01761 case 38: 01762 01763 /* Line 1806 of yacc.c */ 01764 #line 170 "yac.y" 01765 { sqpTable( (yyvsp[(1) - (1)].strval) ); } 01766 break; 01767 01768 case 40: 01769 01770 /* Line 1806 of yacc.c */ 01771 #line 178 "yac.y" 01772 { sqpValue( NULL, 0, 0.0, SQLP_NULL ); } 01773 break; 01774 01775 case 41: 01776 01777 /* Line 1806 of yacc.c */ 01778 #line 179 "yac.y" 01779 { sqpValue( (yyvsp[(1) - (1)].strval), 0, 0.0, SQLP_S ); } 01780 break; 01781 01782 case 42: 01783 01784 /* Line 1806 of yacc.c */ 01785 #line 180 "yac.y" 01786 { sqpValue( NULL, (yyvsp[(1) - (1)].intval), 0.0, SQLP_I ); } 01787 break; 01788 01789 case 43: 01790 01791 /* Line 1806 of yacc.c */ 01792 #line 181 "yac.y" 01793 { sqpValue( NULL, -(yyvsp[(2) - (2)].intval), 0.0, SQLP_I ); } 01794 break; 01795 01796 case 44: 01797 01798 /* Line 1806 of yacc.c */ 01799 #line 182 "yac.y" 01800 { sqpValue( NULL, 0, (yyvsp[(1) - (1)].floatval), SQLP_D ); } 01801 break; 01802 01803 case 45: 01804 01805 /* Line 1806 of yacc.c */ 01806 #line 183 "yac.y" 01807 { sqpValue( NULL, 0, -(yyvsp[(2) - (2)].floatval), SQLP_D ); } 01808 break; 01809 01810 case 46: 01811 01812 /* Line 1806 of yacc.c */ 01813 #line 184 "yac.y" 01814 { sqpValue( NULL, 0, 0.0, SQLP_NULL ); } 01815 break; 01816 01817 case 47: 01818 01819 /* Line 1806 of yacc.c */ 01820 #line 185 "yac.y" 01821 { sqpValue( (yyvsp[(3) - (3)].strval), 0, 0.0, SQLP_S ); } 01822 break; 01823 01824 case 48: 01825 01826 /* Line 1806 of yacc.c */ 01827 #line 186 "yac.y" 01828 { sqpValue( NULL, (yyvsp[(3) - (3)].intval), 0.0, SQLP_I ); } 01829 break; 01830 01831 case 49: 01832 01833 /* Line 1806 of yacc.c */ 01834 #line 187 "yac.y" 01835 { sqpValue( NULL, -(yyvsp[(4) - (4)].intval), 0.0, SQLP_I ); } 01836 break; 01837 01838 case 50: 01839 01840 /* Line 1806 of yacc.c */ 01841 #line 188 "yac.y" 01842 { sqpValue( NULL, 0, (yyvsp[(3) - (3)].floatval), SQLP_D ); } 01843 break; 01844 01845 case 51: 01846 01847 /* Line 1806 of yacc.c */ 01848 #line 189 "yac.y" 01849 { sqpValue( NULL, 0, -(yyvsp[(4) - (4)].floatval), SQLP_D ); } 01850 break; 01851 01852 case 54: 01853 01854 /* Line 1806 of yacc.c */ 01855 #line 198 "yac.y" 01856 { sqpAssignment( (yyvsp[(1) - (3)].strval), NULL, 0, 0.0, NULL, SQLP_NULL ); } 01857 break; 01858 01859 case 55: 01860 01861 /* Line 1806 of yacc.c */ 01862 #line 202 "yac.y" 01863 { sqpAssignment( (yyvsp[(1) - (3)].strval), NULL, 0, 0.0, (yyvsp[(3) - (3)].node), SQLP_EXPR ); } 01864 break; 01865 01866 case 56: 01867 01868 /* Line 1806 of yacc.c */ 01869 #line 206 "yac.y" 01870 { 01871 (yyval.node) = (yyvsp[(1) - (1)].node); 01872 sqlpStmt->upperNodeptr = (yyval.node); 01873 } 01874 break; 01875 01876 case 57: 01877 01878 /* Line 1806 of yacc.c */ 01879 #line 213 "yac.y" 01880 { (yyval.node) = (yyvsp[(1) - (1)].node); } 01881 break; 01882 01883 case 58: 01884 01885 /* Line 1806 of yacc.c */ 01886 #line 214 "yac.y" 01887 { (yyval.node) = sqpNewExpressionNode (SQLP_OR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } 01888 break; 01889 01890 case 59: 01891 01892 /* Line 1806 of yacc.c */ 01893 #line 218 "yac.y" 01894 { (yyval.node) = (yyvsp[(1) - (1)].node); } 01895 break; 01896 01897 case 60: 01898 01899 /* Line 1806 of yacc.c */ 01900 #line 219 "yac.y" 01901 { (yyval.node) = sqpNewExpressionNode (SQLP_AND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } 01902 break; 01903 01904 case 61: 01905 01906 /* Line 1806 of yacc.c */ 01907 #line 223 "yac.y" 01908 { (yyval.node) = (yyvsp[(1) - (1)].node); } 01909 break; 01910 01911 case 62: 01912 01913 /* Line 1806 of yacc.c */ 01914 #line 224 "yac.y" 01915 { (yyval.node) = (yyvsp[(2) - (3)].node); } 01916 break; 01917 01918 case 63: 01919 01920 /* Line 1806 of yacc.c */ 01921 #line 225 "yac.y" 01922 { (yyval.node) = sqpNewExpressionNode ( SQLP_NOT, NULL, (yyvsp[(2) - (2)].node)); } 01923 break; 01924 01925 case 64: 01926 01927 /* Line 1806 of yacc.c */ 01928 #line 230 "yac.y" 01929 { 01930 (yyval.node) = sqpNewExpressionNode ( SQLP_EQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); 01931 } 01932 break; 01933 01934 case 65: 01935 01936 /* Line 1806 of yacc.c */ 01937 #line 233 "yac.y" 01938 { 01939 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode((yyvsp[(2) - (3)].strval)), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); 01940 } 01941 break; 01942 01943 case 66: 01944 01945 /* Line 1806 of yacc.c */ 01946 #line 236 "yac.y" 01947 { 01948 (yyval.node) = sqpNewExpressionNode ( SQLP_ISNULL, NULL, (yyvsp[(1) - (3)].node)); 01949 } 01950 break; 01951 01952 case 67: 01953 01954 /* Line 1806 of yacc.c */ 01955 #line 239 "yac.y" 01956 { 01957 (yyval.node) = sqpNewExpressionNode ( SQLP_NOTNULL, NULL, (yyvsp[(1) - (3)].node)); 01958 } 01959 break; 01960 01961 case 68: 01962 01963 /* Line 1806 of yacc.c */ 01964 #line 246 "yac.y" 01965 { (yyval.node) = (yyvsp[(1) - (1)].node); } 01966 break; 01967 01968 case 69: 01969 01970 /* Line 1806 of yacc.c */ 01971 #line 247 "yac.y" 01972 { 01973 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("+"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) ); 01974 } 01975 break; 01976 01977 case 70: 01978 01979 /* Line 1806 of yacc.c */ 01980 #line 250 "yac.y" 01981 { 01982 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) ); 01983 } 01984 break; 01985 01986 case 71: 01987 01988 /* Line 1806 of yacc.c */ 01989 #line 256 "yac.y" 01990 { (yyval.node) = (yyvsp[(1) - (1)].node); } 01991 break; 01992 01993 case 72: 01994 01995 /* Line 1806 of yacc.c */ 01996 #line 257 "yac.y" 01997 { 01998 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("*"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) ); 01999 } 02000 break; 02001 02002 case 73: 02003 02004 /* Line 1806 of yacc.c */ 02005 #line 260 "yac.y" 02006 { 02007 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("/"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) ); 02008 } 02009 break; 02010 02011 case 74: 02012 02013 /* Line 1806 of yacc.c */ 02014 #line 266 "yac.y" 02015 { (yyval.node) = (yyvsp[(1) - (1)].node); } 02016 break; 02017 02018 case 75: 02019 02020 /* Line 1806 of yacc.c */ 02021 #line 267 "yac.y" 02022 { 02023 (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), sqpNewValueNode ( NULL, 0, 0.0, SQLP_I ), (yyvsp[(2) - (2)].node) ); 02024 } 02025 break; 02026 02027 case 76: 02028 02029 /* Line 1806 of yacc.c */ 02030 #line 273 "yac.y" 02031 { (yyval.node) = (yyvsp[(1) - (1)].node); } 02032 break; 02033 02034 case 77: 02035 02036 /* Line 1806 of yacc.c */ 02037 #line 274 "yac.y" 02038 { (yyval.node) = (yyvsp[(1) - (1)].node); } 02039 break; 02040 02041 case 78: 02042 02043 /* Line 1806 of yacc.c */ 02044 #line 275 "yac.y" 02045 { (yyval.node) = (yyvsp[(2) - (3)].node); } 02046 break; 02047 02048 case 79: 02049 02050 /* Line 1806 of yacc.c */ 02051 #line 280 "yac.y" 02052 { (yyval.node) = sqpNewValueNode ( (yyvsp[(1) - (1)].strval), 0, 0.0, SQLP_S ); } 02053 break; 02054 02055 case 80: 02056 02057 /* Line 1806 of yacc.c */ 02058 #line 281 "yac.y" 02059 { (yyval.node) = sqpNewValueNode ( NULL, (yyvsp[(1) - (1)].intval), 0.0, SQLP_I ); } 02060 break; 02061 02062 case 81: 02063 02064 /* Line 1806 of yacc.c */ 02065 #line 282 "yac.y" 02066 { (yyval.node) = sqpNewValueNode ( NULL, 0, (yyvsp[(1) - (1)].floatval), SQLP_D ); } 02067 break; 02068 02069 case 82: 02070 02071 /* Line 1806 of yacc.c */ 02072 #line 287 "yac.y" 02073 {(yyval.node) = sqpNewColumnNode ( (yyvsp[(1) - (1)].strval) );} 02074 break; 02075 02076 case 85: 02077 02078 /* Line 1806 of yacc.c */ 02079 #line 293 "yac.y" 02080 { sqpOrderColumn( (yyvsp[(1) - (1)].strval), SORT_ASC ); } 02081 break; 02082 02083 case 86: 02084 02085 /* Line 1806 of yacc.c */ 02086 #line 294 "yac.y" 02087 { sqpOrderColumn( (yyvsp[(1) - (2)].strval), SORT_ASC ); } 02088 break; 02089 02090 case 87: 02091 02092 /* Line 1806 of yacc.c */ 02093 #line 297 "yac.y" 02094 { sqpOrderColumn( (yyvsp[(1) - (2)].strval), SORT_DESC ); } 02095 break; 02096 02097 02098 02099 /* Line 1806 of yacc.c */ 02100 #line 2101 "y.tab.c" 02101 default: break; 02102 } 02103 /* User semantic actions sometimes alter yychar, and that requires 02104 that yytoken be updated with the new translation. We take the 02105 approach of translating immediately before every use of yytoken. 02106 One alternative is translating here after every semantic action, 02107 but that translation would be missed if the semantic action invokes 02108 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 02109 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 02110 incorrect destructor might then be invoked immediately. In the 02111 case of YYERROR or YYBACKUP, subsequent parser actions might lead 02112 to an incorrect destructor call or verbose syntax error message 02113 before the lookahead is translated. */ 02114 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 02115 02116 YYPOPSTACK (yylen); 02117 yylen = 0; 02118 YY_STACK_PRINT (yyss, yyssp); 02119 02120 *++yyvsp = yyval; 02121 02122 /* Now `shift' the result of the reduction. Determine what state 02123 that goes to, based on the state we popped back to and the rule 02124 number reduced by. */ 02125 02126 yyn = yyr1[yyn]; 02127 02128 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 02129 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 02130 yystate = yytable[yystate]; 02131 else 02132 yystate = yydefgoto[yyn - YYNTOKENS]; 02133 02134 goto yynewstate; 02135 02136 02137 /*------------------------------------. 02138 | yyerrlab -- here on detecting error | 02139 `------------------------------------*/ 02140 yyerrlab: 02141 /* Make sure we have latest lookahead translation. See comments at 02142 user semantic actions for why this is necessary. */ 02143 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 02144 02145 /* If not already recovering from an error, report this error. */ 02146 if (!yyerrstatus) 02147 { 02148 ++yynerrs; 02149 #if ! YYERROR_VERBOSE 02150 yyerror (YY_("syntax error")); 02151 #else 02152 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 02153 yyssp, yytoken) 02154 { 02155 char const *yymsgp = YY_("syntax error"); 02156 int yysyntax_error_status; 02157 yysyntax_error_status = YYSYNTAX_ERROR; 02158 if (yysyntax_error_status == 0) 02159 yymsgp = yymsg; 02160 else if (yysyntax_error_status == 1) 02161 { 02162 if (yymsg != yymsgbuf) 02163 YYSTACK_FREE (yymsg); 02164 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 02165 if (!yymsg) 02166 { 02167 yymsg = yymsgbuf; 02168 yymsg_alloc = sizeof yymsgbuf; 02169 yysyntax_error_status = 2; 02170 } 02171 else 02172 { 02173 yysyntax_error_status = YYSYNTAX_ERROR; 02174 yymsgp = yymsg; 02175 } 02176 } 02177 yyerror (yymsgp); 02178 if (yysyntax_error_status == 2) 02179 goto yyexhaustedlab; 02180 } 02181 # undef YYSYNTAX_ERROR 02182 #endif 02183 } 02184 02185 02186 02187 if (yyerrstatus == 3) 02188 { 02189 /* If just tried and failed to reuse lookahead token after an 02190 error, discard it. */ 02191 02192 if (yychar <= YYEOF) 02193 { 02194 /* Return failure if at end of input. */ 02195 if (yychar == YYEOF) 02196 YYABORT; 02197 } 02198 else 02199 { 02200 yydestruct ("Error: discarding", 02201 yytoken, &yylval); 02202 yychar = YYEMPTY; 02203 } 02204 } 02205 02206 /* Else will try to reuse lookahead token after shifting the error 02207 token. */ 02208 goto yyerrlab1; 02209 02210 02211 /*---------------------------------------------------. 02212 | yyerrorlab -- error raised explicitly by YYERROR. | 02213 `---------------------------------------------------*/ 02214 yyerrorlab: 02215 02216 /* Pacify compilers like GCC when the user code never invokes 02217 YYERROR and the label yyerrorlab therefore never appears in user 02218 code. */ 02219 if (/*CONSTCOND*/ 0) 02220 goto yyerrorlab; 02221 02222 /* Do not reclaim the symbols of the rule which action triggered 02223 this YYERROR. */ 02224 YYPOPSTACK (yylen); 02225 yylen = 0; 02226 YY_STACK_PRINT (yyss, yyssp); 02227 yystate = *yyssp; 02228 goto yyerrlab1; 02229 02230 02231 /*-------------------------------------------------------------. 02232 | yyerrlab1 -- common code for both syntax error and YYERROR. | 02233 `-------------------------------------------------------------*/ 02234 yyerrlab1: 02235 yyerrstatus = 3; /* Each real token shifted decrements this. */ 02236 02237 for (;;) 02238 { 02239 yyn = yypact[yystate]; 02240 if (!yypact_value_is_default (yyn)) 02241 { 02242 yyn += YYTERROR; 02243 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 02244 { 02245 yyn = yytable[yyn]; 02246 if (0 < yyn) 02247 break; 02248 } 02249 } 02250 02251 /* Pop the current state because it cannot handle the error token. */ 02252 if (yyssp == yyss) 02253 YYABORT; 02254 02255 02256 yydestruct ("Error: popping", 02257 yystos[yystate], yyvsp); 02258 YYPOPSTACK (1); 02259 yystate = *yyssp; 02260 YY_STACK_PRINT (yyss, yyssp); 02261 } 02262 02263 *++yyvsp = yylval; 02264 02265 02266 /* Shift the error token. */ 02267 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 02268 02269 yystate = yyn; 02270 goto yynewstate; 02271 02272 02273 /*-------------------------------------. 02274 | yyacceptlab -- YYACCEPT comes here. | 02275 `-------------------------------------*/ 02276 yyacceptlab: 02277 yyresult = 0; 02278 goto yyreturn; 02279 02280 /*-----------------------------------. 02281 | yyabortlab -- YYABORT comes here. | 02282 `-----------------------------------*/ 02283 yyabortlab: 02284 yyresult = 1; 02285 goto yyreturn; 02286 02287 #if !defined(yyoverflow) || YYERROR_VERBOSE 02288 /*-------------------------------------------------. 02289 | yyexhaustedlab -- memory exhaustion comes here. | 02290 `-------------------------------------------------*/ 02291 yyexhaustedlab: 02292 yyerror (YY_("memory exhausted")); 02293 yyresult = 2; 02294 /* Fall through. */ 02295 #endif 02296 02297 yyreturn: 02298 if (yychar != YYEMPTY) 02299 { 02300 /* Make sure we have latest lookahead translation. See comments at 02301 user semantic actions for why this is necessary. */ 02302 yytoken = YYTRANSLATE (yychar); 02303 yydestruct ("Cleanup: discarding lookahead", 02304 yytoken, &yylval); 02305 } 02306 /* Do not reclaim the symbols of the rule which action triggered 02307 this YYABORT or YYACCEPT. */ 02308 YYPOPSTACK (yylen); 02309 YY_STACK_PRINT (yyss, yyssp); 02310 while (yyssp != yyss) 02311 { 02312 yydestruct ("Cleanup: popping", 02313 yystos[*yyssp], yyvsp); 02314 YYPOPSTACK (1); 02315 } 02316 #ifndef yyoverflow 02317 if (yyss != yyssa) 02318 YYSTACK_FREE (yyss); 02319 #endif 02320 #if YYERROR_VERBOSE 02321 if (yymsg != yymsgbuf) 02322 YYSTACK_FREE (yymsg); 02323 #endif 02324 /* Make sure YYID is used. */ 02325 return YYID (yyresult); 02326 } 02327 02328 02329 02330 /* Line 2067 of yacc.c */ 02331 #line 299 "yac.y" 02332 02333 02334 02335