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