GRASS Programmer's Manual  6.4.3(2013)-r
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
y.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.7.12-4996"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations. */
65 /* Line 371 of yacc.c */
66 #line 21 "yac.y"
67 
68 #include <stdlib.h>
69 #include <string.h>
70 #include <math.h>
71 #include <grass/sqlp.h>
72 
73 #define YYDEBUG 1
74 #define YYERROR_VERBOSE 1
75 
76 
77 /* Line 371 of yacc.c */
78 #line 79 "y.tab.c"
79 
80 # ifndef YY_NULL
81 # if defined __cplusplus && 201103L <= __cplusplus
82 # define YY_NULL nullptr
83 # else
84 # define YY_NULL 0
85 # endif
86 # endif
87 
88 /* Enabling verbose error messages. */
89 #ifdef YYERROR_VERBOSE
90 # undef YYERROR_VERBOSE
91 # define YYERROR_VERBOSE 1
92 #else
93 # define YYERROR_VERBOSE 0
94 #endif
95 
96 /* In a future release of Bison, this section will be replaced
97  by #include "y.tab.h". */
98 #ifndef YY_YY_Y_TAB_H_INCLUDED
99 # define YY_YY_Y_TAB_H_INCLUDED
100 /* Enabling traces. */
101 #ifndef YYDEBUG
102 # define YYDEBUG 0
103 #endif
104 #if YYDEBUG
105 extern int yydebug;
106 #endif
107 
108 /* Tokens. */
109 #ifndef YYTOKENTYPE
110 # define YYTOKENTYPE
111  /* Put the tokens into the symbol table, so that GDB and other debuggers
112  know about them. */
113  enum yytokentype {
115  NAME = 259,
116  STRING = 260,
117  INTNUM = 261,
118  FLOATNUM = 262,
119  ADD = 263,
120  DROP = 264,
121  COLUMN = 265,
122  EQUAL = 266,
123  SELECT = 267,
124  FROM = 268,
125  WHERE = 269,
126  DELETE = 270,
127  INSERT = 271,
128  INTO = 272,
129  VALUES = 273,
130  UPDATE = 274,
131  SET = 275,
132  AND = 276,
133  OR = 277,
134  NOT = 278,
135  ALTER = 279,
136  TABLE = 280,
137  CREATE = 281,
138  NULL_VALUE = 282,
139  VARCHAR = 283,
140  INT = 284,
141  INTEGER = 285,
142  DOUBLE = 286,
143  PRECISION = 287,
144  DATE = 288,
145  TIME = 289,
146  ORDER = 290,
147  BY = 291,
148  IS = 292,
149  ASC = 293,
150  DESC = 294
151  };
152 #endif
153 /* Tokens. */
154 #define COMPARISON_OPERATOR 258
155 #define NAME 259
156 #define STRING 260
157 #define INTNUM 261
158 #define FLOATNUM 262
159 #define ADD 263
160 #define DROP 264
161 #define COLUMN 265
162 #define EQUAL 266
163 #define SELECT 267
164 #define FROM 268
165 #define WHERE 269
166 #define DELETE 270
167 #define INSERT 271
168 #define INTO 272
169 #define VALUES 273
170 #define UPDATE 274
171 #define SET 275
172 #define AND 276
173 #define OR 277
174 #define NOT 278
175 #define ALTER 279
176 #define TABLE 280
177 #define CREATE 281
178 #define NULL_VALUE 282
179 #define VARCHAR 283
180 #define INT 284
181 #define INTEGER 285
182 #define DOUBLE 286
183 #define PRECISION 287
184 #define DATE 288
185 #define TIME 289
186 #define ORDER 290
187 #define BY 291
188 #define IS 292
189 #define ASC 293
190 #define DESC 294
191 
192 
193 
194 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
195 typedef union YYSTYPE
196 {
197 /* Line 387 of yacc.c */
198 #line 34 "yac.y"
199 
200  int intval;
201  double floatval;
202  char *strval;
203  int subtok;
204  SQLPNODE *node;
205 
206 
207 /* Line 387 of yacc.c */
208 #line 209 "y.tab.c"
209 } YYSTYPE;
210 # define YYSTYPE_IS_TRIVIAL 1
211 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
212 # define YYSTYPE_IS_DECLARED 1
213 #endif
214 
215 extern YYSTYPE yylval;
216 
217 #ifdef YYPARSE_PARAM
218 #if defined __STDC__ || defined __cplusplus
219 int yyparse (void *YYPARSE_PARAM);
220 #else
221 int yyparse ();
222 #endif
223 #else /* ! YYPARSE_PARAM */
224 #if defined __STDC__ || defined __cplusplus
225 int yyparse (void);
226 #else
227 int yyparse ();
228 #endif
229 #endif /* ! YYPARSE_PARAM */
230 
231 #endif /* !YY_YY_Y_TAB_H_INCLUDED */
232 
233 /* Copy the second part of user declarations. */
234 /* Line 390 of yacc.c */
235 #line 88 "yac.y"
236 
237 
238 extern int yylex(void);
239 
240 
241 /* Line 390 of yacc.c */
242 #line 243 "y.tab.c"
243 
244 #ifdef short
245 # undef short
246 #endif
247 
248 #ifdef YYTYPE_UINT8
249 typedef YYTYPE_UINT8 yytype_uint8;
250 #else
251 typedef unsigned char yytype_uint8;
252 #endif
253 
254 #ifdef YYTYPE_INT8
255 typedef YYTYPE_INT8 yytype_int8;
256 #elif (defined __STDC__ || defined __C99__FUNC__ \
257  || defined __cplusplus || defined _MSC_VER)
258 typedef signed char yytype_int8;
259 #else
260 typedef short int yytype_int8;
261 #endif
262 
263 #ifdef YYTYPE_UINT16
264 typedef YYTYPE_UINT16 yytype_uint16;
265 #else
266 typedef unsigned short int yytype_uint16;
267 #endif
268 
269 #ifdef YYTYPE_INT16
270 typedef YYTYPE_INT16 yytype_int16;
271 #else
272 typedef short int yytype_int16;
273 #endif
274 
275 #ifndef YYSIZE_T
276 # ifdef __SIZE_TYPE__
277 # define YYSIZE_T __SIZE_TYPE__
278 # elif defined size_t
279 # define YYSIZE_T size_t
280 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
281  || defined __cplusplus || defined _MSC_VER)
282 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
283 # define YYSIZE_T size_t
284 # else
285 # define YYSIZE_T unsigned int
286 # endif
287 #endif
288 
289 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
290 
291 #ifndef YY_
292 # if defined YYENABLE_NLS && YYENABLE_NLS
293 # if ENABLE_NLS
294 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
295 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
296 # endif
297 # endif
298 # ifndef YY_
299 # define YY_(Msgid) Msgid
300 # endif
301 #endif
302 
303 #ifndef __attribute__
304 /* This feature is available in gcc versions 2.5 and later. */
305 # if (! defined __GNUC__ || __GNUC__ < 2 \
306  || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
307 # define __attribute__(Spec) /* empty */
308 # endif
309 #endif
310 
311 /* Suppress unused-variable warnings by "using" E. */
312 #if ! defined lint || defined __GNUC__
313 # define YYUSE(E) ((void) (E))
314 #else
315 # define YYUSE(E) /* empty */
316 #endif
317 
318 
319 /* Identity function, used to suppress warnings about constant conditions. */
320 #ifndef lint
321 # define YYID(N) (N)
322 #else
323 #if (defined __STDC__ || defined __C99__FUNC__ \
324  || defined __cplusplus || defined _MSC_VER)
325 static int
326 YYID (int yyi)
327 #else
328 static int
329 YYID (yyi)
330  int yyi;
331 #endif
332 {
333  return yyi;
334 }
335 #endif
336 
337 #if ! defined yyoverflow || YYERROR_VERBOSE
338 
339 /* The parser invokes alloca or malloc; define the necessary symbols. */
340 
341 # ifdef YYSTACK_USE_ALLOCA
342 # if YYSTACK_USE_ALLOCA
343 # ifdef __GNUC__
344 # define YYSTACK_ALLOC __builtin_alloca
345 # elif defined __BUILTIN_VA_ARG_INCR
346 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
347 # elif defined _AIX
348 # define YYSTACK_ALLOC __alloca
349 # elif defined _MSC_VER
350 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
351 # define alloca _alloca
352 # else
353 # define YYSTACK_ALLOC alloca
354 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
355  || defined __cplusplus || defined _MSC_VER)
356 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
357  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
358 # ifndef EXIT_SUCCESS
359 # define EXIT_SUCCESS 0
360 # endif
361 # endif
362 # endif
363 # endif
364 # endif
365 
366 # ifdef YYSTACK_ALLOC
367  /* Pacify GCC's `empty if-body' warning. */
368 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
369 # ifndef YYSTACK_ALLOC_MAXIMUM
370  /* The OS might guarantee only one guard page at the bottom of the stack,
371  and a page size can be as small as 4096 bytes. So we cannot safely
372  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
373  to allow for a few compiler-allocated temporary stack slots. */
374 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
375 # endif
376 # else
377 # define YYSTACK_ALLOC YYMALLOC
378 # define YYSTACK_FREE YYFREE
379 # ifndef YYSTACK_ALLOC_MAXIMUM
380 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
381 # endif
382 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
383  && ! ((defined YYMALLOC || defined malloc) \
384  && (defined YYFREE || defined free)))
385 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
386 # ifndef EXIT_SUCCESS
387 # define EXIT_SUCCESS 0
388 # endif
389 # endif
390 # ifndef YYMALLOC
391 # define YYMALLOC malloc
392 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
393  || defined __cplusplus || defined _MSC_VER)
394 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
395 # endif
396 # endif
397 # ifndef YYFREE
398 # define YYFREE free
399 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
400  || defined __cplusplus || defined _MSC_VER)
401 void free (void *); /* INFRINGES ON USER NAME SPACE */
402 # endif
403 # endif
404 # endif
405 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
406 
407 
408 #if (! defined yyoverflow \
409  && (! defined __cplusplus \
410  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
411 
412 /* A type that is properly aligned for any stack member. */
413 union yyalloc
414 {
417 };
418 
419 /* The size of the maximum gap between one aligned stack and the next. */
420 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
421 
422 /* The size of an array large to enough to hold all stacks, each with
423  N elements. */
424 # define YYSTACK_BYTES(N) \
425  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
426  + YYSTACK_GAP_MAXIMUM)
427 
428 # define YYCOPY_NEEDED 1
429 
430 /* Relocate STACK from its old location to the new one. The
431  local variables YYSIZE and YYSTACKSIZE give the old and new number of
432  elements in the stack, and YYPTR gives the new location of the
433  stack. Advance YYPTR to a properly aligned location for the next
434  stack. */
435 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
436  do \
437  { \
438  YYSIZE_T yynewbytes; \
439  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
440  Stack = &yyptr->Stack_alloc; \
441  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
442  yyptr += yynewbytes / sizeof (*yyptr); \
443  } \
444  while (YYID (0))
445 
446 #endif
447 
448 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
449 /* Copy COUNT objects from SRC to DST. The source and destination do
450  not overlap. */
451 # ifndef YYCOPY
452 # if defined __GNUC__ && 1 < __GNUC__
453 # define YYCOPY(Dst, Src, Count) \
454  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
455 # else
456 # define YYCOPY(Dst, Src, Count) \
457  do \
458  { \
459  YYSIZE_T yyi; \
460  for (yyi = 0; yyi < (Count); yyi++) \
461  (Dst)[yyi] = (Src)[yyi]; \
462  } \
463  while (YYID (0))
464 # endif
465 # endif
466 #endif /* !YYCOPY_NEEDED */
467 
468 /* YYFINAL -- State number of the termination state. */
469 #define YYFINAL 27
470 /* YYLAST -- Last index in YYTABLE. */
471 #define YYLAST 156
472 
473 /* YYNTOKENS -- Number of terminals. */
474 #define YYNTOKENS 48
475 /* YYNNTS -- Number of nonterminals. */
476 #define YYNNTS 32
477 /* YYNRULES -- Number of rules. */
478 #define YYNRULES 87
479 /* YYNRULES -- Number of states. */
480 #define YYNSTATES 157
481 
482 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
483 #define YYUNDEFTOK 2
484 #define YYMAXUTOK 294
485 
486 #define YYTRANSLATE(YYX) \
487  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
488 
489 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
490 static const yytype_uint8 yytranslate[] =
491 {
492  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496  41, 42, 44, 46, 43, 45, 2, 47, 2, 2,
497  2, 2, 2, 2, 2, 2, 2, 2, 2, 40,
498  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
518  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
519  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
520  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
521  35, 36, 37, 38, 39
522 };
523 
524 #if YYDEBUG
525 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
526  YYRHS. */
527 static const yytype_uint16 yyprhs[] =
528 {
529  0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
530  20, 27, 33, 40, 47, 51, 56, 63, 71, 81,
531  85, 91, 96, 104, 109, 116, 118, 122, 128, 131,
532  134, 137, 141, 144, 147, 149, 151, 153, 157, 159,
533  164, 166, 168, 170, 173, 175, 178, 182, 186, 190,
534  195, 199, 204, 206, 210, 214, 218, 220, 222, 226,
535  228, 232, 234, 238, 241, 245, 249, 253, 257, 259,
536  263, 267, 269, 273, 277, 279, 282, 284, 286, 290,
537  292, 294, 296, 298, 300, 302, 304, 307
538 };
539 
540 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
541 static const yytype_int8 yyrhs[] =
542 {
543  49, 0, -1, 50, -1, 51, -1, 52, -1, 55,
544  -1, 53, -1, 56, -1, 54, -1, 49, 40, -1,
545  24, 25, 61, 8, 10, 58, -1, 24, 25, 61,
546  8, 58, -1, 24, 25, 61, 9, 10, 4, -1,
547  26, 25, 61, 41, 57, 42, -1, 9, 25, 61,
548  -1, 12, 59, 13, 61, -1, 12, 59, 13, 61,
549  14, 66, -1, 12, 59, 13, 61, 35, 36, 77,
550  -1, 12, 59, 13, 61, 14, 66, 35, 36, 77,
551  -1, 15, 13, 61, -1, 15, 13, 61, 14, 66,
552  -1, 16, 17, 61, 62, -1, 16, 17, 61, 41,
553  59, 42, 62, -1, 19, 61, 20, 64, -1, 19,
554  61, 20, 64, 14, 66, -1, 58, -1, 57, 43,
555  58, -1, 4, 28, 41, 6, 42, -1, 4, 29,
556  -1, 4, 30, -1, 4, 31, -1, 4, 31, 32,
557  -1, 4, 33, -1, 4, 34, -1, 44, -1, 60,
558  -1, 4, -1, 60, 43, 4, -1, 4, -1, 18,
559  41, 63, 42, -1, 27, -1, 5, -1, 6, -1,
560  45, 6, -1, 7, -1, 45, 7, -1, 63, 43,
561  27, -1, 63, 43, 5, -1, 63, 43, 6, -1,
562  63, 43, 45, 6, -1, 63, 43, 7, -1, 63,
563  43, 45, 7, -1, 65, -1, 64, 43, 65, -1,
564  4, 11, 27, -1, 4, 11, 71, -1, 67, -1,
565  68, -1, 67, 22, 68, -1, 69, -1, 68, 21,
566  69, -1, 70, -1, 41, 67, 42, -1, 23, 69,
567  -1, 71, 11, 71, -1, 71, 3, 71, -1, 71,
568  37, 27, -1, 71, 23, 27, -1, 72, -1, 71,
569  46, 72, -1, 71, 45, 72, -1, 73, -1, 72,
570  44, 73, -1, 72, 47, 73, -1, 74, -1, 45,
571  73, -1, 75, -1, 76, -1, 41, 71, 42, -1,
572  5, -1, 6, -1, 7, -1, 4, -1, 78, -1,
573  79, -1, 4, -1, 4, 38, -1, 4, 39, -1
574 };
575 
576 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
577 static const yytype_uint16 yyrline[] =
578 {
579  0, 97, 97, 98, 99, 100, 101, 102, 103, 104,
580  108, 109, 110, 114, 118, 122, 123, 124, 125, 129,
581  130, 134, 135, 139, 140, 145, 146, 150, 151, 152,
582  153, 154, 155, 156, 160, 161, 165, 166, 170, 174,
583  178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
584  188, 189, 193, 194, 198, 202, 206, 213, 214, 218,
585  219, 223, 224, 225, 230, 233, 236, 239, 246, 247,
586  250, 256, 257, 260, 266, 267, 273, 274, 275, 280,
587  281, 282, 287, 290, 290, 293, 294, 297
588 };
589 #endif
590 
591 #if YYDEBUG || YYERROR_VERBOSE || 0
592 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
593  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
594 static const char *const yytname[] =
595 {
596  "$end", "error", "$undefined", "COMPARISON_OPERATOR", "NAME", "STRING",
597  "INTNUM", "FLOATNUM", "ADD", "DROP", "COLUMN", "EQUAL", "SELECT", "FROM",
598  "WHERE", "DELETE", "INSERT", "INTO", "VALUES", "UPDATE", "SET", "AND",
599  "OR", "NOT", "ALTER", "TABLE", "CREATE", "NULL_VALUE", "VARCHAR", "INT",
600  "INTEGER", "DOUBLE", "PRECISION", "DATE", "TIME", "ORDER", "BY", "IS",
601  "ASC", "DESC", "';'", "'('", "')'", "','", "'*'", "'-'", "'+'", "'/'",
602  "$accept", "y_sql", "y_alter", "y_create", "y_drop", "y_select",
603  "y_delete", "y_insert", "y_update", "y_columndefs", "y_columndef",
604  "y_columns", "y_column_list", "y_table", "y_values", "y_value_list",
605  "y_assignments", "y_assignment", "y_condition", "y_sub_condition",
606  "y_sub_condition2", "y_boolean", "y_comparison", "y_expression",
607  "y_product", "y_term", "y_atom", "y_value", "y_column", "y_order",
608  "y_order_asc", "y_order_desc", YY_NULL
609 };
610 #endif
611 
612 # ifdef YYPRINT
613 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
614  token YYLEX-NUM. */
615 static const yytype_uint16 yytoknum[] =
616 {
617  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
618  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
619  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
620  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
621  59, 40, 41, 44, 42, 45, 43, 47
622 };
623 # endif
624 
625 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
626 static const yytype_uint8 yyr1[] =
627 {
628  0, 48, 49, 49, 49, 49, 49, 49, 49, 49,
629  50, 50, 50, 51, 52, 53, 53, 53, 53, 54,
630  54, 55, 55, 56, 56, 57, 57, 58, 58, 58,
631  58, 58, 58, 58, 59, 59, 60, 60, 61, 62,
632  63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
633  63, 63, 64, 64, 65, 65, 66, 67, 67, 68,
634  68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
635  71, 72, 72, 72, 73, 73, 74, 74, 74, 75,
636  75, 75, 76, 77, 77, 78, 78, 79
637 };
638 
639 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
640 static const yytype_uint8 yyr2[] =
641 {
642  0, 2, 1, 1, 1, 1, 1, 1, 1, 2,
643  6, 5, 6, 6, 3, 4, 6, 7, 9, 3,
644  5, 4, 7, 4, 6, 1, 3, 5, 2, 2,
645  2, 3, 2, 2, 1, 1, 1, 3, 1, 4,
646  1, 1, 1, 2, 1, 2, 3, 3, 3, 4,
647  3, 4, 1, 3, 3, 3, 1, 1, 3, 1,
648  3, 1, 3, 2, 3, 3, 3, 3, 1, 3,
649  3, 1, 3, 3, 1, 2, 1, 1, 3, 1,
650  1, 1, 1, 1, 1, 1, 2, 2
651 };
652 
653 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
654  Performed when YYTABLE doesn't specify something else to do. Zero
655  means the default is an error. */
656 static const yytype_uint8 yydefact[] =
657 {
658  0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
659  3, 4, 6, 8, 5, 7, 0, 36, 34, 0,
660  35, 0, 0, 38, 0, 0, 0, 1, 9, 14,
661  0, 0, 19, 0, 0, 0, 0, 15, 37, 0,
662  0, 0, 21, 0, 23, 52, 0, 0, 0, 0,
663  0, 82, 79, 80, 81, 0, 0, 0, 20, 56,
664  57, 59, 61, 0, 68, 71, 74, 76, 77, 0,
665  0, 0, 0, 0, 0, 0, 11, 0, 0, 25,
666  16, 0, 63, 0, 0, 0, 75, 0, 0, 0,
667  0, 0, 0, 0, 0, 0, 0, 41, 42, 44,
668  40, 0, 0, 0, 54, 55, 24, 53, 0, 28,
669  29, 30, 32, 33, 10, 12, 13, 0, 0, 85,
670  17, 83, 84, 62, 78, 0, 58, 60, 65, 64,
671  67, 66, 70, 69, 72, 73, 43, 45, 39, 0,
672  22, 0, 31, 26, 0, 86, 87, 47, 48, 50,
673  46, 0, 0, 18, 49, 51, 27
674 };
675 
676 /* YYDEFGOTO[NTERM-NUM]. */
677 static const yytype_int8 yydefgoto[] =
678 {
679  -1, 8, 9, 10, 11, 12, 13, 14, 15, 78,
680  76, 19, 20, 24, 42, 102, 44, 45, 58, 59,
681  60, 61, 62, 63, 64, 65, 66, 67, 68, 120,
682  121, 122
683 };
684 
685 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
686  STATE-NUM. */
687 #define YYPACT_NINF -52
688 static const yytype_int16 yypact[] =
689 {
690  64, -8, 3, 11, 5, 32, 49, 57, 2, -52,
691  -52, -52, -52, -52, -52, -52, 32, -52, -52, 39,
692  41, 32, 32, -52, 102, 32, 32, -52, -52, -52,
693  32, 85, 109, 7, 95, 10, 83, 37, -52, 8,
694  84, 3, -52, 115, -10, -52, 6, 117, 124, 8,
695  93, -52, -52, -52, -52, 8, 8, 55, -52, 108,
696  110, -52, -52, 0, 31, -52, -52, -52, -52, 23,
697  90, 50, 8, 95, 79, 124, -52, 129, 24, -52,
698  99, 131, -52, -16, -2, 55, -52, 8, 8, 55,
699  55, 111, 113, 55, 55, 55, 55, -52, -52, -52,
700  -52, 80, 51, 118, -52, 59, -52, -52, 96, -52,
701  -52, 107, -52, -52, -52, -52, -52, 124, 105, 78,
702  -52, -52, -52, -52, -52, 69, 110, -52, 59, 59,
703  -52, -52, 31, 31, -52, -52, -52, -52, -52, 58,
704  -52, 136, -52, -52, 131, -52, -52, -52, -52, -52,
705  -52, 112, 101, -52, -52, -52, -52
706 };
707 
708 /* YYPGOTO[NTERM-NUM]. */
709 static const yytype_int8 yypgoto[] =
710 {
711  -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
712  -48, 103, -52, 76, 42, -52, -52, 73, 9, 91,
713  61, -47, -52, -51, 27, -25, -52, -52, -52, 12,
714  -52, -52
715 };
716 
717 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
718  positive, shift that token. If negative, reduce the rule which
719  number is the opposite. If YYTABLE_NINF, syntax error. */
720 #define YYTABLE_NINF -1
721 static const yytype_uint8 yytable[] =
722 {
723  79, 89, 27, 89, 72, 84, 87, 17, 82, 90,
724  74, 90, 51, 52, 53, 54, 75, 16, 46, 47,
725  105, 91, 22, 91, 21, 40, 123, 114, 97, 98,
726  99, 55, 86, 73, 125, 92, 23, 92, 128, 129,
727  124, 127, 28, 93, 94, 93, 94, 18, 41, 56,
728  100, 49, 30, 57, 51, 52, 53, 54, 80, 51,
729  52, 53, 54, 147, 148, 149, 116, 117, 101, 143,
730  134, 135, 50, 1, 25, 95, 2, 104, 96, 3,
731  4, 106, 26, 5, 31, 150, 136, 137, 6, 38,
732  7, 85, 29, 138, 139, 57, 85, 32, 33, 43,
733  57, 35, 36, 151, 93, 94, 37, 108, 109, 110,
734  111, 124, 112, 113, 93, 94, 145, 146, 154, 155,
735  132, 133, 34, 39, 48, 69, 71, 77, 74, 81,
736  87, 88, 103, 115, 118, 119, 40, 141, 130, 142,
737  131, 144, 152, 156, 70, 140, 107, 83, 126, 0,
738  0, 0, 0, 0, 0, 0, 153
739 };
740 
741 #define yypact_value_is_default(Yystate) \
742  (!!((Yystate) == (-52)))
743 
744 #define yytable_value_is_error(Yytable_value) \
745  YYID (0)
746 
747 static const yytype_int16 yycheck[] =
748 {
749  48, 3, 0, 3, 14, 56, 22, 4, 55, 11,
750  4, 11, 4, 5, 6, 7, 10, 25, 8, 9,
751  71, 23, 17, 23, 13, 18, 42, 75, 5, 6,
752  7, 23, 57, 43, 85, 37, 4, 37, 89, 90,
753  42, 88, 40, 45, 46, 45, 46, 44, 41, 41,
754  27, 14, 13, 45, 4, 5, 6, 7, 49, 4,
755  5, 6, 7, 5, 6, 7, 42, 43, 45, 117,
756  95, 96, 35, 9, 25, 44, 12, 27, 47, 15,
757  16, 72, 25, 19, 43, 27, 6, 7, 24, 4,
758  26, 41, 16, 42, 43, 45, 41, 21, 22, 4,
759  45, 25, 26, 45, 45, 46, 30, 28, 29, 30,
760  31, 42, 33, 34, 45, 46, 38, 39, 6, 7,
761  93, 94, 20, 14, 41, 41, 11, 10, 4, 36,
762  22, 21, 42, 4, 35, 4, 18, 41, 27, 32,
763  27, 36, 6, 42, 41, 103, 73, 56, 87, -1,
764  -1, -1, -1, -1, -1, -1, 144
765 };
766 
767 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
768  symbol of state STATE-NUM. */
769 static const yytype_uint8 yystos[] =
770 {
771  0, 9, 12, 15, 16, 19, 24, 26, 49, 50,
772  51, 52, 53, 54, 55, 56, 25, 4, 44, 59,
773  60, 13, 17, 4, 61, 25, 25, 0, 40, 61,
774  13, 43, 61, 61, 20, 61, 61, 61, 4, 14,
775  18, 41, 62, 4, 64, 65, 8, 9, 41, 14,
776  35, 4, 5, 6, 7, 23, 41, 45, 66, 67,
777  68, 69, 70, 71, 72, 73, 74, 75, 76, 41,
778  59, 11, 14, 43, 4, 10, 58, 10, 57, 58,
779  66, 36, 69, 67, 71, 41, 73, 22, 21, 3,
780  11, 23, 37, 45, 46, 44, 47, 5, 6, 7,
781  27, 45, 63, 42, 27, 71, 66, 65, 28, 29,
782  30, 31, 33, 34, 58, 4, 42, 43, 35, 4,
783  77, 78, 79, 42, 42, 71, 68, 69, 71, 71,
784  27, 27, 72, 72, 73, 73, 6, 7, 42, 43,
785  62, 41, 32, 58, 36, 38, 39, 5, 6, 7,
786  27, 45, 6, 77, 6, 7, 42
787 };
788 
789 #define yyerrok (yyerrstatus = 0)
790 #define yyclearin (yychar = YYEMPTY)
791 #define YYEMPTY (-2)
792 #define YYEOF 0
793 
794 #define YYACCEPT goto yyacceptlab
795 #define YYABORT goto yyabortlab
796 #define YYERROR goto yyerrorlab
797 
798 
799 /* Like YYERROR except do call yyerror. This remains here temporarily
800  to ease the transition to the new meaning of YYERROR, for GCC.
801  Once GCC version 2 has supplanted version 1, this can go. However,
802  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
803  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
804  discussed. */
805 
806 #define YYFAIL goto yyerrlab
807 #if defined YYFAIL
808  /* This is here to suppress warnings from the GCC cpp's
809  -Wunused-macros. Normally we don't worry about that warning, but
810  some users do, and we want to make it easy for users to remove
811  YYFAIL uses, which will produce warnings from Bison 2.5. */
812 #endif
813 
814 #define YYRECOVERING() (!!yyerrstatus)
815 
816 #define YYBACKUP(Token, Value) \
817 do \
818  if (yychar == YYEMPTY) \
819  { \
820  yychar = (Token); \
821  yylval = (Value); \
822  YYPOPSTACK (yylen); \
823  yystate = *yyssp; \
824  goto yybackup; \
825  } \
826  else \
827  { \
828  yyerror (YY_("syntax error: cannot back up")); \
829  YYERROR; \
830  } \
831 while (YYID (0))
832 
833 /* Error token number */
834 #define YYTERROR 1
835 #define YYERRCODE 256
836 
837 
838 /* This macro is provided for backward compatibility. */
839 #ifndef YY_LOCATION_PRINT
840 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
841 #endif
842 
843 
844 /* YYLEX -- calling `yylex' with the right arguments. */
845 #ifdef YYLEX_PARAM
846 # define YYLEX yylex (YYLEX_PARAM)
847 #else
848 # define YYLEX yylex ()
849 #endif
850 
851 /* Enable debugging if requested. */
852 #if YYDEBUG
853 
854 # ifndef YYFPRINTF
855 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
856 # define YYFPRINTF fprintf
857 # endif
858 
859 # define YYDPRINTF(Args) \
860 do { \
861  if (yydebug) \
862  YYFPRINTF Args; \
863 } while (YYID (0))
864 
865 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
866 do { \
867  if (yydebug) \
868  { \
869  YYFPRINTF (stderr, "%s ", Title); \
870  yy_symbol_print (stderr, \
871  Type, Value); \
872  YYFPRINTF (stderr, "\n"); \
873  } \
874 } while (YYID (0))
875 
876 
877 /*--------------------------------.
878 | Print this symbol on YYOUTPUT. |
879 `--------------------------------*/
880 
881 /*ARGSUSED*/
882 #if (defined __STDC__ || defined __C99__FUNC__ \
883  || defined __cplusplus || defined _MSC_VER)
884 static void
885 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
886 #else
887 static void
888 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
889  FILE *yyoutput;
890  int yytype;
891  YYSTYPE const * const yyvaluep;
892 #endif
893 {
894  FILE *yyo = yyoutput;
895  YYUSE (yyo);
896  if (!yyvaluep)
897  return;
898 # ifdef YYPRINT
899  if (yytype < YYNTOKENS)
900  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
901 # else
902  YYUSE (yyoutput);
903 # endif
904  YYUSE (yytype);
905 }
906 
907 
908 /*--------------------------------.
909 | Print this symbol on YYOUTPUT. |
910 `--------------------------------*/
911 
912 #if (defined __STDC__ || defined __C99__FUNC__ \
913  || defined __cplusplus || defined _MSC_VER)
914 static void
915 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
916 #else
917 static void
918 yy_symbol_print (yyoutput, yytype, yyvaluep)
919  FILE *yyoutput;
920  int yytype;
921  YYSTYPE const * const yyvaluep;
922 #endif
923 {
924  if (yytype < YYNTOKENS)
925  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
926  else
927  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
928 
929  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
930  YYFPRINTF (yyoutput, ")");
931 }
932 
933 /*------------------------------------------------------------------.
934 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
935 | TOP (included). |
936 `------------------------------------------------------------------*/
937 
938 #if (defined __STDC__ || defined __C99__FUNC__ \
939  || defined __cplusplus || defined _MSC_VER)
940 static void
941 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
942 #else
943 static void
944 yy_stack_print (yybottom, yytop)
945  yytype_int16 *yybottom;
946  yytype_int16 *yytop;
947 #endif
948 {
949  YYFPRINTF (stderr, "Stack now");
950  for (; yybottom <= yytop; yybottom++)
951  {
952  int yybot = *yybottom;
953  YYFPRINTF (stderr, " %d", yybot);
954  }
955  YYFPRINTF (stderr, "\n");
956 }
957 
958 # define YY_STACK_PRINT(Bottom, Top) \
959 do { \
960  if (yydebug) \
961  yy_stack_print ((Bottom), (Top)); \
962 } while (YYID (0))
963 
964 
965 /*------------------------------------------------.
966 | Report that the YYRULE is going to be reduced. |
967 `------------------------------------------------*/
968 
969 #if (defined __STDC__ || defined __C99__FUNC__ \
970  || defined __cplusplus || defined _MSC_VER)
971 static void
972 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
973 #else
974 static void
975 yy_reduce_print (yyvsp, yyrule)
976  YYSTYPE *yyvsp;
977  int yyrule;
978 #endif
979 {
980  int yynrhs = yyr2[yyrule];
981  int yyi;
982  unsigned long int yylno = yyrline[yyrule];
983  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
984  yyrule - 1, yylno);
985  /* The symbols being reduced. */
986  for (yyi = 0; yyi < yynrhs; yyi++)
987  {
988  YYFPRINTF (stderr, " $%d = ", yyi + 1);
989  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
990  &(yyvsp[(yyi + 1) - (yynrhs)])
991  );
992  YYFPRINTF (stderr, "\n");
993  }
994 }
995 
996 # define YY_REDUCE_PRINT(Rule) \
997 do { \
998  if (yydebug) \
999  yy_reduce_print (yyvsp, Rule); \
1000 } while (YYID (0))
1001 
1002 /* Nonzero means print parse trace. It is left uninitialized so that
1003  multiple parsers can coexist. */
1005 #else /* !YYDEBUG */
1006 # define YYDPRINTF(Args)
1007 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1008 # define YY_STACK_PRINT(Bottom, Top)
1009 # define YY_REDUCE_PRINT(Rule)
1010 #endif /* !YYDEBUG */
1011 
1012 
1013 /* YYINITDEPTH -- initial size of the parser's stacks. */
1014 #ifndef YYINITDEPTH
1015 # define YYINITDEPTH 200
1016 #endif
1017 
1018 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1019  if the built-in stack extension method is used).
1020 
1021  Do not make this value too large; the results are undefined if
1022  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1023  evaluated with infinite-precision integer arithmetic. */
1024 
1025 #ifndef YYMAXDEPTH
1026 # define YYMAXDEPTH 10000
1027 #endif
1028 
1029 
1030 #if YYERROR_VERBOSE
1031 
1032 # ifndef yystrlen
1033 # if defined __GLIBC__ && defined _STRING_H
1034 # define yystrlen strlen
1035 # else
1036 /* Return the length of YYSTR. */
1037 #if (defined __STDC__ || defined __C99__FUNC__ \
1038  || defined __cplusplus || defined _MSC_VER)
1039 static YYSIZE_T
1040 yystrlen (const char *yystr)
1041 #else
1042 static YYSIZE_T
1043 yystrlen (yystr)
1044  const char *yystr;
1045 #endif
1047  YYSIZE_T yylen;
1048  for (yylen = 0; yystr[yylen]; yylen++)
1049  continue;
1050  return yylen;
1051 }
1052 # endif
1053 # endif
1054 
1055 # ifndef yystpcpy
1056 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1057 # define yystpcpy stpcpy
1058 # else
1059 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1060  YYDEST. */
1061 #if (defined __STDC__ || defined __C99__FUNC__ \
1062  || defined __cplusplus || defined _MSC_VER)
1063 static char *
1064 yystpcpy (char *yydest, const char *yysrc)
1065 #else
1066 static char *
1067 yystpcpy (yydest, yysrc)
1068  char *yydest;
1069  const char *yysrc;
1070 #endif
1071 {
1072  char *yyd = yydest;
1073  const char *yys = yysrc;
1074 
1075  while ((*yyd++ = *yys++) != '\0')
1076  continue;
1077 
1078  return yyd - 1;
1079 }
1080 # endif
1081 # endif
1082 
1083 # ifndef yytnamerr
1084 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1085  quotes and backslashes, so that it's suitable for yyerror. The
1086  heuristic is that double-quoting is unnecessary unless the string
1087  contains an apostrophe, a comma, or backslash (other than
1088  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1089  null, do not copy; instead, return the length of what the result
1090  would have been. */
1091 static YYSIZE_T
1092 yytnamerr (char *yyres, const char *yystr)
1093 {
1094  if (*yystr == '"')
1095  {
1096  YYSIZE_T yyn = 0;
1097  char const *yyp = yystr;
1098 
1099  for (;;)
1100  switch (*++yyp)
1101  {
1102  case '\'':
1103  case ',':
1104  goto do_not_strip_quotes;
1105 
1106  case '\\':
1107  if (*++yyp != '\\')
1108  goto do_not_strip_quotes;
1109  /* Fall through. */
1110  default:
1111  if (yyres)
1112  yyres[yyn] = *yyp;
1113  yyn++;
1114  break;
1115 
1116  case '"':
1117  if (yyres)
1118  yyres[yyn] = '\0';
1119  return yyn;
1120  }
1121  do_not_strip_quotes: ;
1122  }
1123 
1124  if (! yyres)
1125  return yystrlen (yystr);
1126 
1127  return yystpcpy (yyres, yystr) - yyres;
1128 }
1129 # endif
1130 
1131 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1132  about the unexpected token YYTOKEN for the state stack whose top is
1133  YYSSP.
1134 
1135  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1136  not large enough to hold the message. In that case, also set
1137  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1138  required number of bytes is too large to store. */
1139 static int
1140 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1141  yytype_int16 *yyssp, int yytoken)
1142 {
1143  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1144  YYSIZE_T yysize = yysize0;
1145  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1146  /* Internationalized format string. */
1147  const char *yyformat = YY_NULL;
1148  /* Arguments of yyformat. */
1149  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1150  /* Number of reported tokens (one for the "unexpected", one per
1151  "expected"). */
1152  int yycount = 0;
1153 
1154  /* There are many possibilities here to consider:
1155  - Assume YYFAIL is not used. It's too flawed to consider. See
1156  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1157  for details. YYERROR is fine as it does not invoke this
1158  function.
1159  - If this state is a consistent state with a default action, then
1160  the only way this function was invoked is if the default action
1161  is an error action. In that case, don't check for expected
1162  tokens because there are none.
1163  - The only way there can be no lookahead present (in yychar) is if
1164  this state is a consistent state with a default action. Thus,
1165  detecting the absence of a lookahead is sufficient to determine
1166  that there is no unexpected or expected token to report. In that
1167  case, just report a simple "syntax error".
1168  - Don't assume there isn't a lookahead just because this state is a
1169  consistent state with a default action. There might have been a
1170  previous inconsistent state, consistent state with a non-default
1171  action, or user semantic action that manipulated yychar.
1172  - Of course, the expected token list depends on states to have
1173  correct lookahead information, and it depends on the parser not
1174  to perform extra reductions after fetching a lookahead from the
1175  scanner and before detecting a syntax error. Thus, state merging
1176  (from LALR or IELR) and default reductions corrupt the expected
1177  token list. However, the list is correct for canonical LR with
1178  one exception: it will still contain any token that will not be
1179  accepted due to an error action in a later state.
1180  */
1181  if (yytoken != YYEMPTY)
1182  {
1183  int yyn = yypact[*yyssp];
1184  yyarg[yycount++] = yytname[yytoken];
1185  if (!yypact_value_is_default (yyn))
1186  {
1187  /* Start YYX at -YYN if negative to avoid negative indexes in
1188  YYCHECK. In other words, skip the first -YYN actions for
1189  this state because they are default actions. */
1190  int yyxbegin = yyn < 0 ? -yyn : 0;
1191  /* Stay within bounds of both yycheck and yytname. */
1192  int yychecklim = YYLAST - yyn + 1;
1193  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1194  int yyx;
1195 
1196  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1197  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1198  && !yytable_value_is_error (yytable[yyx + yyn]))
1199  {
1200  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1201  {
1202  yycount = 1;
1203  yysize = yysize0;
1204  break;
1205  }
1206  yyarg[yycount++] = yytname[yyx];
1207  {
1208  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1209  if (! (yysize <= yysize1
1210  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1211  return 2;
1212  yysize = yysize1;
1213  }
1214  }
1215  }
1216  }
1217 
1218  switch (yycount)
1219  {
1220 # define YYCASE_(N, S) \
1221  case N: \
1222  yyformat = S; \
1223  break
1224  YYCASE_(0, YY_("syntax error"));
1225  YYCASE_(1, YY_("syntax error, unexpected %s"));
1226  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1227  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1228  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1229  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1230 # undef YYCASE_
1231  }
1232 
1233  {
1234  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1235  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1236  return 2;
1237  yysize = yysize1;
1238  }
1239 
1240  if (*yymsg_alloc < yysize)
1241  {
1242  *yymsg_alloc = 2 * yysize;
1243  if (! (yysize <= *yymsg_alloc
1244  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1245  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1246  return 1;
1247  }
1248 
1249  /* Avoid sprintf, as that infringes on the user's name space.
1250  Don't have undefined behavior even if the translation
1251  produced a string with the wrong number of "%s"s. */
1252  {
1253  char *yyp = *yymsg;
1254  int yyi = 0;
1255  while ((*yyp = *yyformat) != '\0')
1256  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1257  {
1258  yyp += yytnamerr (yyp, yyarg[yyi++]);
1259  yyformat += 2;
1260  }
1261  else
1262  {
1263  yyp++;
1264  yyformat++;
1265  }
1266  }
1267  return 0;
1268 }
1269 #endif /* YYERROR_VERBOSE */
1270 
1271 /*-----------------------------------------------.
1272 | Release the memory associated to this symbol. |
1273 `-----------------------------------------------*/
1274 
1275 /*ARGSUSED*/
1276 #if (defined __STDC__ || defined __C99__FUNC__ \
1277  || defined __cplusplus || defined _MSC_VER)
1278 static void
1279 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1280 #else
1281 static void
1282 yydestruct (yymsg, yytype, yyvaluep)
1283  const char *yymsg;
1284  int yytype;
1285  YYSTYPE *yyvaluep;
1286 #endif
1287 {
1288  YYUSE (yyvaluep);
1289 
1290  if (!yymsg)
1291  yymsg = "Deleting";
1292  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1293 
1294  YYUSE (yytype);
1295 }
1296 
1297 
1298 
1299 
1300 /* The lookahead symbol. */
1302 
1303 
1304 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1305 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1306 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1307 #endif
1308 #ifndef YY_INITIAL_VALUE
1309 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1310 #endif
1311 
1312 /* The semantic value of the lookahead symbol. */
1313 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1314 
1315 /* Number of syntax errors so far. */
1317 
1318 
1319 /*----------.
1320 | yyparse. |
1321 `----------*/
1322 
1323 #ifdef YYPARSE_PARAM
1324 #if (defined __STDC__ || defined __C99__FUNC__ \
1325  || defined __cplusplus || defined _MSC_VER)
1326 int
1327 yyparse (void *YYPARSE_PARAM)
1328 #else
1329 int
1330 yyparse (YYPARSE_PARAM)
1331  void *YYPARSE_PARAM;
1332 #endif
1333 #else /* ! YYPARSE_PARAM */
1334 #if (defined __STDC__ || defined __C99__FUNC__ \
1335  || defined __cplusplus || defined _MSC_VER)
1336 int
1337 yyparse (void)
1338 #else
1339 int
1340 yyparse ()
1341 
1342 #endif
1343 #endif
1345  int yystate;
1346  /* Number of tokens to shift before error messages enabled. */
1348 
1349  /* The stacks and their tools:
1350  `yyss': related to states.
1351  `yyvs': related to semantic values.
1352 
1353  Refer to the stacks through separate pointers, to allow yyoverflow
1354  to reallocate them elsewhere. */
1355 
1356  /* The state stack. */
1360 
1361  /* The semantic value stack. */
1364  YYSTYPE *yyvsp;
1365 
1367 
1368  int yyn;
1370  /* Lookahead token as an internal (translated) token number. */
1371  int yytoken = 0;
1372  /* The variables used to return semantic value and location from the
1373  action routines. */
1375 
1376 #if YYERROR_VERBOSE
1377  /* Buffer for error messages, and its allocated size. */
1378  char yymsgbuf[128];
1379  char *yymsg = yymsgbuf;
1380  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1381 #endif
1382 
1383 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1384 
1385  /* The number of symbols on the RHS of the reduced rule.
1386  Keep to zero when no symbol should be popped. */
1387  int yylen = 0;
1388 
1389  yyssp = yyss = yyssa;
1390  yyvsp = yyvs = yyvsa;
1391  yystacksize = YYINITDEPTH;
1392 
1393  YYDPRINTF ((stderr, "Starting parse\n"));
1394 
1395  yystate = 0;
1396  yyerrstatus = 0;
1397  yynerrs = 0;
1398  yychar = YYEMPTY; /* Cause a token to be read. */
1400 
1401 /*------------------------------------------------------------.
1402 | yynewstate -- Push a new state, which is found in yystate. |
1403 `------------------------------------------------------------*/
1404  yynewstate:
1405  /* In all cases, when you get here, the value and location stacks
1406  have just been pushed. So pushing a state here evens the stacks. */
1407  yyssp++;
1408 
1409  yysetstate:
1410  *yyssp = yystate;
1411 
1412  if (yyss + yystacksize - 1 <= yyssp)
1413  {
1414  /* Get the current used size of the three stacks, in elements. */
1415  YYSIZE_T yysize = yyssp - yyss + 1;
1416 
1417 #ifdef yyoverflow
1418  {
1419  /* Give user a chance to reallocate the stack. Use copies of
1420  these so that the &'s don't force the real ones into
1421  memory. */
1422  YYSTYPE *yyvs1 = yyvs;
1423  yytype_int16 *yyss1 = yyss;
1424 
1425  /* Each stack pointer address is followed by the size of the
1426  data in use in that stack, in bytes. This used to be a
1427  conditional around just the two extra args, but that might
1428  be undefined if yyoverflow is a macro. */
1429  yyoverflow (YY_("memory exhausted"),
1430  &yyss1, yysize * sizeof (*yyssp),
1431  &yyvs1, yysize * sizeof (*yyvsp),
1432  &yystacksize);
1433 
1434  yyss = yyss1;
1435  yyvs = yyvs1;
1436  }
1437 #else /* no yyoverflow */
1438 # ifndef YYSTACK_RELOCATE
1439  goto yyexhaustedlab;
1440 # else
1441  /* Extend the stack our own way. */
1442  if (YYMAXDEPTH <= yystacksize)
1443  goto yyexhaustedlab;
1444  yystacksize *= 2;
1445  if (YYMAXDEPTH < yystacksize)
1446  yystacksize = YYMAXDEPTH;
1447 
1448  {
1449  yytype_int16 *yyss1 = yyss;
1450  union yyalloc *yyptr =
1451  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1452  if (! yyptr)
1453  goto yyexhaustedlab;
1454  YYSTACK_RELOCATE (yyss_alloc, yyss);
1455  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1456 # undef YYSTACK_RELOCATE
1457  if (yyss1 != yyssa)
1458  YYSTACK_FREE (yyss1);
1459  }
1460 # endif
1461 #endif /* no yyoverflow */
1462 
1463  yyssp = yyss + yysize - 1;
1464  yyvsp = yyvs + yysize - 1;
1465 
1466  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1467  (unsigned long int) yystacksize));
1468 
1469  if (yyss + yystacksize - 1 <= yyssp)
1470  YYABORT;
1471  }
1472 
1473  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1474 
1475  if (yystate == YYFINAL)
1477 
1478  goto yybackup;
1479 
1480 /*-----------.
1481 | yybackup. |
1482 `-----------*/
1483 yybackup:
1484 
1485  /* Do appropriate processing given the current state. Read a
1486  lookahead token if we need one and don't already have one. */
1487 
1488  /* First try to decide what to do without reference to lookahead token. */
1489  yyn = yypact[yystate];
1490  if (yypact_value_is_default (yyn))
1492 
1493  /* Not known => get a lookahead token if don't already have one. */
1494 
1495  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1496  if (yychar == YYEMPTY)
1497  {
1498  YYDPRINTF ((stderr, "Reading a token: "));
1499  yychar = YYLEX;
1500  }
1501 
1502  if (yychar <= YYEOF)
1503  {
1504  yychar = yytoken = YYEOF;
1505  YYDPRINTF ((stderr, "Now at end of input.\n"));
1506  }
1507  else
1508  {
1509  yytoken = YYTRANSLATE (yychar);
1510  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1511  }
1512 
1513  /* If the proper action on seeing token YYTOKEN is to reduce or to
1514  detect an error, take that action. */
1515  yyn += yytoken;
1516  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1517  goto yydefault;
1518  yyn = yytable[yyn];
1519  if (yyn <= 0)
1520  {
1521  if (yytable_value_is_error (yyn))
1522  goto yyerrlab;
1523  yyn = -yyn;
1524  goto yyreduce;
1525  }
1526 
1527  /* Count tokens shifted since error; after three, turn off error
1528  status. */
1529  if (yyerrstatus)
1530  yyerrstatus--;
1531 
1532  /* Shift the lookahead token. */
1533  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1534 
1535  /* Discard the shifted token. */
1536  yychar = YYEMPTY;
1537 
1538  yystate = yyn;
1540  *++yyvsp = yylval;
1542 
1544 
1545 
1546 /*-----------------------------------------------------------.
1547 | yydefault -- do the default action for the current state. |
1548 `-----------------------------------------------------------*/
1549 yydefault:
1550  yyn = yydefact[yystate];
1551  if (yyn == 0)
1552  goto yyerrlab;
1553  goto yyreduce;
1554 
1555 
1556 /*-----------------------------.
1557 | yyreduce -- Do a reduction. |
1558 `-----------------------------*/
1559 yyreduce:
1560  /* yyn is the number of a rule to reduce with. */
1561  yylen = yyr2[yyn];
1562 
1563  /* If YYLEN is nonzero, implement the default value of the action:
1564  `$$ = $1'.
1565 
1566  Otherwise, the following line sets YYVAL to garbage.
1567  This behavior is undocumented and Bison
1568  users should not rely upon it. Assigning to YYVAL
1569  unconditionally makes the parser a bit smaller, and it avoids a
1570  GCC warning that YYVAL may be used uninitialized. */
1571  yyval = yyvsp[1-yylen];
1572 
1573 
1574  YY_REDUCE_PRINT (yyn);
1575  switch (yyn)
1576  {
1577  case 10:
1578 /* Line 1787 of yacc.c */
1579 #line 108 "yac.y"
1580  { sqpCommand(SQLP_ADD_COLUMN); }
1581  break;
1582 
1583  case 11:
1584 /* Line 1787 of yacc.c */
1585 #line 109 "yac.y"
1586  { sqpCommand(SQLP_ADD_COLUMN); }
1587  break;
1588 
1589  case 12:
1590 /* Line 1787 of yacc.c */
1591 #line 110 "yac.y"
1592  { sqpCommand(SQLP_DROP_COLUMN); sqpColumn((yyvsp[(6) - (6)].strval));}
1593  break;
1594 
1595  case 13:
1596 /* Line 1787 of yacc.c */
1597 #line 114 "yac.y"
1598  { sqpCommand(SQLP_CREATE); }
1599  break;
1600 
1601  case 14:
1602 /* Line 1787 of yacc.c */
1603 #line 118 "yac.y"
1604  { sqpCommand(SQLP_DROP); }
1605  break;
1606 
1607  case 15:
1608 /* Line 1787 of yacc.c */
1609 #line 122 "yac.y"
1610  { sqpCommand(SQLP_SELECT); }
1611  break;
1612 
1613  case 16:
1614 /* Line 1787 of yacc.c */
1615 #line 123 "yac.y"
1616  { sqpCommand(SQLP_SELECT); }
1617  break;
1618 
1619  case 17:
1620 /* Line 1787 of yacc.c */
1621 #line 124 "yac.y"
1622  { sqpCommand(SQLP_SELECT); }
1623  break;
1624 
1625  case 18:
1626 /* Line 1787 of yacc.c */
1627 #line 125 "yac.y"
1628  { sqpCommand(SQLP_SELECT); }
1629  break;
1630 
1631  case 19:
1632 /* Line 1787 of yacc.c */
1633 #line 129 "yac.y"
1634  { sqpCommand(SQLP_DELETE); }
1635  break;
1636 
1637  case 20:
1638 /* Line 1787 of yacc.c */
1639 #line 130 "yac.y"
1640  { sqpCommand(SQLP_DELETE); }
1641  break;
1642 
1643  case 21:
1644 /* Line 1787 of yacc.c */
1645 #line 134 "yac.y"
1646  { sqpCommand(SQLP_INSERT); }
1647  break;
1648 
1649  case 22:
1650 /* Line 1787 of yacc.c */
1651 #line 135 "yac.y"
1652  { sqpCommand(SQLP_INSERT); }
1653  break;
1654 
1655  case 23:
1656 /* Line 1787 of yacc.c */
1657 #line 139 "yac.y"
1658  { sqpCommand(SQLP_UPDATE); }
1659  break;
1660 
1661  case 24:
1662 /* Line 1787 of yacc.c */
1663 #line 140 "yac.y"
1664  { sqpCommand(SQLP_UPDATE); }
1665  break;
1666 
1667  case 27:
1668 /* Line 1787 of yacc.c */
1669 #line 150 "yac.y"
1670  { sqpColumnDef( (yyvsp[(1) - (5)].strval), SQLP_VARCHAR, (yyvsp[(4) - (5)].intval), 0 ); }
1671  break;
1672 
1673  case 28:
1674 /* Line 1787 of yacc.c */
1675 #line 151 "yac.y"
1676  { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_INTEGER, 0, 0 ); }
1677  break;
1678 
1679  case 29:
1680 /* Line 1787 of yacc.c */
1681 #line 152 "yac.y"
1682  { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_INTEGER, 0, 0 ); }
1683  break;
1684 
1685  case 30:
1686 /* Line 1787 of yacc.c */
1687 #line 153 "yac.y"
1688  { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_DOUBLE, 0, 0 ); }
1689  break;
1690 
1691  case 31:
1692 /* Line 1787 of yacc.c */
1693 #line 154 "yac.y"
1694  { sqpColumnDef( (yyvsp[(1) - (3)].strval), SQLP_DOUBLE, 0, 0 ); }
1695  break;
1696 
1697  case 32:
1698 /* Line 1787 of yacc.c */
1699 #line 155 "yac.y"
1700  { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_DATE, 0, 0 ); }
1701  break;
1702 
1703  case 33:
1704 /* Line 1787 of yacc.c */
1705 #line 156 "yac.y"
1706  { sqpColumnDef( (yyvsp[(1) - (2)].strval), SQLP_TIME, 0, 0 ); }
1707  break;
1708 
1709  case 36:
1710 /* Line 1787 of yacc.c */
1711 #line 165 "yac.y"
1712  { sqpColumn( (yyvsp[(1) - (1)].strval) ); }
1713  break;
1714 
1715  case 37:
1716 /* Line 1787 of yacc.c */
1717 #line 166 "yac.y"
1718  { sqpColumn( (yyvsp[(3) - (3)].strval) ); }
1719  break;
1720 
1721  case 38:
1722 /* Line 1787 of yacc.c */
1723 #line 170 "yac.y"
1724  { sqpTable( (yyvsp[(1) - (1)].strval) ); }
1725  break;
1726 
1727  case 40:
1728 /* Line 1787 of yacc.c */
1729 #line 178 "yac.y"
1730  { sqpValue( NULL, 0, 0.0, SQLP_NULL ); }
1731  break;
1732 
1733  case 41:
1734 /* Line 1787 of yacc.c */
1735 #line 179 "yac.y"
1736  { sqpValue( (yyvsp[(1) - (1)].strval), 0, 0.0, SQLP_S ); }
1737  break;
1738 
1739  case 42:
1740 /* Line 1787 of yacc.c */
1741 #line 180 "yac.y"
1742  { sqpValue( NULL, (yyvsp[(1) - (1)].intval), 0.0, SQLP_I ); }
1743  break;
1744 
1745  case 43:
1746 /* Line 1787 of yacc.c */
1747 #line 181 "yac.y"
1748  { sqpValue( NULL, -(yyvsp[(2) - (2)].intval), 0.0, SQLP_I ); }
1749  break;
1750 
1751  case 44:
1752 /* Line 1787 of yacc.c */
1753 #line 182 "yac.y"
1754  { sqpValue( NULL, 0, (yyvsp[(1) - (1)].floatval), SQLP_D ); }
1755  break;
1756 
1757  case 45:
1758 /* Line 1787 of yacc.c */
1759 #line 183 "yac.y"
1760  { sqpValue( NULL, 0, -(yyvsp[(2) - (2)].floatval), SQLP_D ); }
1761  break;
1762 
1763  case 46:
1764 /* Line 1787 of yacc.c */
1765 #line 184 "yac.y"
1766  { sqpValue( NULL, 0, 0.0, SQLP_NULL ); }
1767  break;
1768 
1769  case 47:
1770 /* Line 1787 of yacc.c */
1771 #line 185 "yac.y"
1772  { sqpValue( (yyvsp[(3) - (3)].strval), 0, 0.0, SQLP_S ); }
1773  break;
1774 
1775  case 48:
1776 /* Line 1787 of yacc.c */
1777 #line 186 "yac.y"
1778  { sqpValue( NULL, (yyvsp[(3) - (3)].intval), 0.0, SQLP_I ); }
1779  break;
1780 
1781  case 49:
1782 /* Line 1787 of yacc.c */
1783 #line 187 "yac.y"
1784  { sqpValue( NULL, -(yyvsp[(4) - (4)].intval), 0.0, SQLP_I ); }
1785  break;
1786 
1787  case 50:
1788 /* Line 1787 of yacc.c */
1789 #line 188 "yac.y"
1790  { sqpValue( NULL, 0, (yyvsp[(3) - (3)].floatval), SQLP_D ); }
1791  break;
1792 
1793  case 51:
1794 /* Line 1787 of yacc.c */
1795 #line 189 "yac.y"
1796  { sqpValue( NULL, 0, -(yyvsp[(4) - (4)].floatval), SQLP_D ); }
1797  break;
1798 
1799  case 54:
1800 /* Line 1787 of yacc.c */
1801 #line 198 "yac.y"
1802  { sqpAssignment( (yyvsp[(1) - (3)].strval), NULL, 0, 0.0, NULL, SQLP_NULL ); }
1803  break;
1804 
1805  case 55:
1806 /* Line 1787 of yacc.c */
1807 #line 202 "yac.y"
1808  { sqpAssignment( (yyvsp[(1) - (3)].strval), NULL, 0, 0.0, (yyvsp[(3) - (3)].node), SQLP_EXPR ); }
1809  break;
1810 
1811  case 56:
1812 /* Line 1787 of yacc.c */
1813 #line 206 "yac.y"
1814  {
1815  (yyval.node) = (yyvsp[(1) - (1)].node);
1816  sqlpStmt->upperNodeptr = (yyval.node);
1817  }
1818  break;
1819 
1820  case 57:
1821 /* Line 1787 of yacc.c */
1822 #line 213 "yac.y"
1823  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1824  break;
1825 
1826  case 58:
1827 /* Line 1787 of yacc.c */
1828 #line 214 "yac.y"
1829  { (yyval.node) = sqpNewExpressionNode (SQLP_OR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); }
1830  break;
1831 
1832  case 59:
1833 /* Line 1787 of yacc.c */
1834 #line 218 "yac.y"
1835  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1836  break;
1837 
1838  case 60:
1839 /* Line 1787 of yacc.c */
1840 #line 219 "yac.y"
1841  { (yyval.node) = sqpNewExpressionNode (SQLP_AND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); }
1842  break;
1843 
1844  case 61:
1845 /* Line 1787 of yacc.c */
1846 #line 223 "yac.y"
1847  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1848  break;
1849 
1850  case 62:
1851 /* Line 1787 of yacc.c */
1852 #line 224 "yac.y"
1853  { (yyval.node) = (yyvsp[(2) - (3)].node); }
1854  break;
1855 
1856  case 63:
1857 /* Line 1787 of yacc.c */
1858 #line 225 "yac.y"
1859  { (yyval.node) = sqpNewExpressionNode ( SQLP_NOT, NULL, (yyvsp[(2) - (2)].node)); }
1860  break;
1861 
1862  case 64:
1863 /* Line 1787 of yacc.c */
1864 #line 230 "yac.y"
1865  {
1866  (yyval.node) = sqpNewExpressionNode ( SQLP_EQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1867  }
1868  break;
1869 
1870  case 65:
1871 /* Line 1787 of yacc.c */
1872 #line 233 "yac.y"
1873  {
1874  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode((yyvsp[(2) - (3)].strval)), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1875  }
1876  break;
1877 
1878  case 66:
1879 /* Line 1787 of yacc.c */
1880 #line 236 "yac.y"
1881  {
1882  (yyval.node) = sqpNewExpressionNode ( SQLP_ISNULL, NULL, (yyvsp[(1) - (3)].node));
1883  }
1884  break;
1885 
1886  case 67:
1887 /* Line 1787 of yacc.c */
1888 #line 239 "yac.y"
1889  {
1890  (yyval.node) = sqpNewExpressionNode ( SQLP_NOTNULL, NULL, (yyvsp[(1) - (3)].node));
1891  }
1892  break;
1893 
1894  case 68:
1895 /* Line 1787 of yacc.c */
1896 #line 246 "yac.y"
1897  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1898  break;
1899 
1900  case 69:
1901 /* Line 1787 of yacc.c */
1902 #line 247 "yac.y"
1903  {
1904  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("+"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) );
1905  }
1906  break;
1907 
1908  case 70:
1909 /* Line 1787 of yacc.c */
1910 #line 250 "yac.y"
1911  {
1912  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) );
1913  }
1914  break;
1915 
1916  case 71:
1917 /* Line 1787 of yacc.c */
1918 #line 256 "yac.y"
1919  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1920  break;
1921 
1922  case 72:
1923 /* Line 1787 of yacc.c */
1924 #line 257 "yac.y"
1925  {
1926  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("*"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) );
1927  }
1928  break;
1929 
1930  case 73:
1931 /* Line 1787 of yacc.c */
1932 #line 260 "yac.y"
1933  {
1934  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("/"), (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node) );
1935  }
1936  break;
1937 
1938  case 74:
1939 /* Line 1787 of yacc.c */
1940 #line 266 "yac.y"
1941  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1942  break;
1943 
1944  case 75:
1945 /* Line 1787 of yacc.c */
1946 #line 267 "yac.y"
1947  {
1948  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), sqpNewValueNode ( NULL, 0, 0.0, SQLP_I ), (yyvsp[(2) - (2)].node) );
1949  }
1950  break;
1951 
1952  case 76:
1953 /* Line 1787 of yacc.c */
1954 #line 273 "yac.y"
1955  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1956  break;
1957 
1958  case 77:
1959 /* Line 1787 of yacc.c */
1960 #line 274 "yac.y"
1961  { (yyval.node) = (yyvsp[(1) - (1)].node); }
1962  break;
1963 
1964  case 78:
1965 /* Line 1787 of yacc.c */
1966 #line 275 "yac.y"
1967  { (yyval.node) = (yyvsp[(2) - (3)].node); }
1968  break;
1969 
1970  case 79:
1971 /* Line 1787 of yacc.c */
1972 #line 280 "yac.y"
1973  { (yyval.node) = sqpNewValueNode ( (yyvsp[(1) - (1)].strval), 0, 0.0, SQLP_S ); }
1974  break;
1975 
1976  case 80:
1977 /* Line 1787 of yacc.c */
1978 #line 281 "yac.y"
1979  { (yyval.node) = sqpNewValueNode ( NULL, (yyvsp[(1) - (1)].intval), 0.0, SQLP_I ); }
1980  break;
1981 
1982  case 81:
1983 /* Line 1787 of yacc.c */
1984 #line 282 "yac.y"
1985  { (yyval.node) = sqpNewValueNode ( NULL, 0, (yyvsp[(1) - (1)].floatval), SQLP_D ); }
1986  break;
1987 
1988  case 82:
1989 /* Line 1787 of yacc.c */
1990 #line 287 "yac.y"
1991  {(yyval.node) = sqpNewColumnNode ( (yyvsp[(1) - (1)].strval) );}
1992  break;
1993 
1994  case 85:
1995 /* Line 1787 of yacc.c */
1996 #line 293 "yac.y"
1997  { sqpOrderColumn( (yyvsp[(1) - (1)].strval), SORT_ASC ); }
1998  break;
1999 
2000  case 86:
2001 /* Line 1787 of yacc.c */
2002 #line 294 "yac.y"
2003  { sqpOrderColumn( (yyvsp[(1) - (2)].strval), SORT_ASC ); }
2004  break;
2005 
2006  case 87:
2007 /* Line 1787 of yacc.c */
2008 #line 297 "yac.y"
2009  { sqpOrderColumn( (yyvsp[(1) - (2)].strval), SORT_DESC ); }
2010  break;
2011 
2012 
2013 /* Line 1787 of yacc.c */
2014 #line 2015 "y.tab.c"
2015  default: break;
2016  }
2017  /* User semantic actions sometimes alter yychar, and that requires
2018  that yytoken be updated with the new translation. We take the
2019  approach of translating immediately before every use of yytoken.
2020  One alternative is translating here after every semantic action,
2021  but that translation would be missed if the semantic action invokes
2022  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2023  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2024  incorrect destructor might then be invoked immediately. In the
2025  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2026  to an incorrect destructor call or verbose syntax error message
2027  before the lookahead is translated. */
2028  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2029 
2030  YYPOPSTACK (yylen);
2031  yylen = 0;
2032  YY_STACK_PRINT (yyss, yyssp);
2033 
2034  *++yyvsp = yyval;
2035 
2036  /* Now `shift' the result of the reduction. Determine what state
2037  that goes to, based on the state we popped back to and the rule
2038  number reduced by. */
2039 
2040  yyn = yyr1[yyn];
2041 
2042  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2043  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2044  yystate = yytable[yystate];
2045  else
2046  yystate = yydefgoto[yyn - YYNTOKENS];
2047 
2048  goto yynewstate;
2049 
2050 
2051 /*------------------------------------.
2052 | yyerrlab -- here on detecting error |
2053 `------------------------------------*/
2054 yyerrlab:
2055  /* Make sure we have latest lookahead translation. See comments at
2056  user semantic actions for why this is necessary. */
2057  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2058 
2059  /* If not already recovering from an error, report this error. */
2060  if (!yyerrstatus)
2061  {
2062  ++yynerrs;
2063 #if ! YYERROR_VERBOSE
2064  yyerror (YY_("syntax error"));
2065 #else
2066 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2067  yyssp, yytoken)
2068  {
2069  char const *yymsgp = YY_("syntax error");
2070  int yysyntax_error_status;
2071  yysyntax_error_status = YYSYNTAX_ERROR;
2072  if (yysyntax_error_status == 0)
2073  yymsgp = yymsg;
2074  else if (yysyntax_error_status == 1)
2075  {
2076  if (yymsg != yymsgbuf)
2077  YYSTACK_FREE (yymsg);
2078  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2079  if (!yymsg)
2080  {
2081  yymsg = yymsgbuf;
2082  yymsg_alloc = sizeof yymsgbuf;
2083  yysyntax_error_status = 2;
2084  }
2085  else
2086  {
2087  yysyntax_error_status = YYSYNTAX_ERROR;
2088  yymsgp = yymsg;
2089  }
2090  }
2091  yyerror (yymsgp);
2092  if (yysyntax_error_status == 2)
2093  goto yyexhaustedlab;
2094  }
2095 # undef YYSYNTAX_ERROR
2096 #endif
2097  }
2098 
2099 
2100 
2101  if (yyerrstatus == 3)
2102  {
2103  /* If just tried and failed to reuse lookahead token after an
2104  error, discard it. */
2105 
2106  if (yychar <= YYEOF)
2107  {
2108  /* Return failure if at end of input. */
2109  if (yychar == YYEOF)
2110  YYABORT;
2111  }
2112  else
2113  {
2114  yydestruct ("Error: discarding",
2115  yytoken, &yylval);
2116  yychar = YYEMPTY;
2117  }
2118  }
2119 
2120  /* Else will try to reuse lookahead token after shifting the error
2121  token. */
2123 
2124 
2125 /*---------------------------------------------------.
2126 | yyerrorlab -- error raised explicitly by YYERROR. |
2127 `---------------------------------------------------*/
2128 yyerrorlab:
2129 
2130  /* Pacify compilers like GCC when the user code never invokes
2131  YYERROR and the label yyerrorlab therefore never appears in user
2132  code. */
2133  if (/*CONSTCOND*/ 0)
2134  goto yyerrorlab;
2135 
2136  /* Do not reclaim the symbols of the rule which action triggered
2137  this YYERROR. */
2138  YYPOPSTACK (yylen);
2139  yylen = 0;
2140  YY_STACK_PRINT (yyss, yyssp);
2141  yystate = *yyssp;
2142  goto yyerrlab1;
2143 
2144 
2145 /*-------------------------------------------------------------.
2146 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2147 `-------------------------------------------------------------*/
2148 yyerrlab1:
2149  yyerrstatus = 3; /* Each real token shifted decrements this. */
2150 
2151  for (;;)
2152  {
2153  yyn = yypact[yystate];
2154  if (!yypact_value_is_default (yyn))
2155  {
2156  yyn += YYTERROR;
2157  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2158  {
2159  yyn = yytable[yyn];
2160  if (0 < yyn)
2161  break;
2162  }
2163  }
2164 
2165  /* Pop the current state because it cannot handle the error token. */
2166  if (yyssp == yyss)
2167  YYABORT;
2168 
2169 
2170  yydestruct ("Error: popping",
2171  yystos[yystate], yyvsp);
2172  YYPOPSTACK (1);
2173  yystate = *yyssp;
2174  YY_STACK_PRINT (yyss, yyssp);
2175  }
2176 
2178  *++yyvsp = yylval;
2180 
2181 
2182  /* Shift the error token. */
2183  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2184 
2185  yystate = yyn;
2186  goto yynewstate;
2187 
2188 
2189 /*-------------------------------------.
2190 | yyacceptlab -- YYACCEPT comes here. |
2191 `-------------------------------------*/
2192 yyacceptlab:
2193  yyresult = 0;
2194  goto yyreturn;
2195 
2196 /*-----------------------------------.
2197 | yyabortlab -- YYABORT comes here. |
2198 `-----------------------------------*/
2199 yyabortlab:
2200  yyresult = 1;
2201  goto yyreturn;
2202 
2203 #if !defined yyoverflow || YYERROR_VERBOSE
2204 /*-------------------------------------------------.
2205 | yyexhaustedlab -- memory exhaustion comes here. |
2206 `-------------------------------------------------*/
2207 yyexhaustedlab:
2208  yyerror (YY_("memory exhausted"));
2209  yyresult = 2;
2210  /* Fall through. */
2211 #endif
2212 
2213 yyreturn:
2214  if (yychar != YYEMPTY)
2215  {
2216  /* Make sure we have latest lookahead translation. See comments at
2217  user semantic actions for why this is necessary. */
2218  yytoken = YYTRANSLATE (yychar);
2219  yydestruct ("Cleanup: discarding lookahead",
2220  yytoken, &yylval);
2221  }
2222  /* Do not reclaim the symbols of the rule which action triggered
2223  this YYABORT or YYACCEPT. */
2224  YYPOPSTACK (yylen);
2225  YY_STACK_PRINT (yyss, yyssp);
2226  while (yyssp != yyss)
2227  {
2228  yydestruct ("Cleanup: popping",
2229  yystos[*yyssp], yyvsp);
2230  YYPOPSTACK (1);
2231  }
2232 #ifndef yyoverflow
2233  if (yyss != yyssa)
2234  YYSTACK_FREE (yyss);
2235 #endif
2236 #if YYERROR_VERBOSE
2237  if (yymsg != yymsgbuf)
2238  YYSTACK_FREE (yymsg);
2239 #endif
2240  /* Make sure YYID is used. */
2241  return YYID (yyresult);
2242 }
2243 
2244 
2245 /* Line 2050 of yacc.c */
2246 #line 299 "yac.y"
2247 
2248 
2249 
yytokentype
Definition: y.tab.c:113
int yytoken
Definition: y.tab.c:1371
#define YY_NULL
Definition: y.tab.c:84
#define YYPOPSTACK(N)
Definition: y.tab.c:1383
#define YYEMPTY
Definition: y.tab.c:791
#define NOT
Definition: y.tab.c:174
#define YYSIZE_T
Definition: y.tab.c:285
short int yytype_int16
Definition: y.tab.c:272
double floatval
Definition: y.tab.c:201
#define YYSTACK_ALLOC_MAXIMUM
Definition: y.tab.c:380
int yyrule
Definition: y.tab.c:977
YYSIZE_T yystacksize
Definition: y.tab.c:1366
#define DELETE
Definition: y.tab.c:166
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: y.tab.c:1306
#define ORDER
Definition: y.tab.c:186
goto yydefault
Definition: y.tab.c:1491
#define DESC
Definition: y.tab.c:190
int
Definition: y.tab.c:1344
goto yyerrlab1
Definition: y.tab.c:2122
#define YYUSE(E)
Definition: y.tab.c:313
yytype_int16 yyssa[YYINITDEPTH]
Definition: y.tab.c:1357
#define PRECISION
Definition: y.tab.c:183
int subtok
Definition: y.tab.c:203
#define INTO
Definition: y.tab.c:168
#define TIME
Definition: y.tab.c:185
void sqpColumn(char *col)
Definition: sql.c:102
int intval
Definition: y.tab.c:200
#define YYDPRINTF(Args)
Definition: y.tab.c:859
int yydebug
Definition: y.tab.c:1004
SQLPNODE * sqpNewColumnNode(char *name)
Definition: sql.c:231
int yyerrstatus
Definition: y.tab.c:1347
void sqpColumnDef(char *col, int type, int width, int decimals)
Definition: sql.c:114
YYSTYPE yyvsa[YYINITDEPTH]
Definition: y.tab.c:1362
unsigned long int yylno
Definition: y.tab.c:982
#define YYSTACK_BYTES(N)
Definition: y.tab.c:424
#define TABLE
Definition: y.tab.c:176
#define STRING
Definition: y.tab.c:156
#define YYSTACK_FREE
Definition: y.tab.c:378
#define YYMAXDEPTH
Definition: y.tab.c:1026
#define EQUAL
Definition: y.tab.c:162
char * strval
Definition: y.tab.c:202
int yytype
Definition: y.tab.c:890
unsigned char yytype_uint8
Definition: y.tab.c:251
#define YYFINAL
Definition: y.tab.c:469
#define INT
Definition: y.tab.c:180
#define INSERT
Definition: y.tab.c:167
Definition: form.c:18
#define UPDATE
Definition: y.tab.c:170
YYSTYPE * yyvs
Definition: y.tab.c:1363
int sqpOperatorCode(char *oper)
Definition: sql.c:280
#define VALUES
Definition: y.tab.c:169
#define CREATE
Definition: y.tab.c:177
int yyparse()
#define YY_(Msgid)
Definition: y.tab.c:299
YYSTYPE yylval
void sqpTable(char *tbl)
Definition: sql.c:96
#define YYINITDEPTH
Definition: y.tab.c:1015
const char * yysrc
Definition: y.tab.c:1069
SQLPNODE * sqpNewValueNode(char *strval, int intval, double dblval, int type)
Definition: sql.c:243
char yymsgbuf[128]
Definition: y.tab.c:1378
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: y.tab.c:1305
#define YYFPRINTF
Definition: y.tab.c:856
goto yybackup
Definition: y.tab.c:1478
yytype_int16 yyss_alloc
Definition: y.tab.c:415
#define DOUBLE
Definition: y.tab.c:182
#define WHERE
Definition: y.tab.c:165
yystate
Definition: y.tab.c:1395
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval)
YYSTYPE yyval
Definition: y.tab.c:1374
return yyd
Definition: y.tab.c:1078
#define FLOATNUM
Definition: y.tab.c:158
YYSTYPE yyvs_alloc
Definition: y.tab.c:416
#define YY_REDUCE_PRINT(Rule)
Definition: y.tab.c:996
const char * yys
Definition: y.tab.c:1073
#define YYID(N)
Definition: y.tab.c:321
YYSIZE_T yymsg_alloc
Definition: y.tab.c:1380
#define YYTERROR
Definition: y.tab.c:834
#define BY
Definition: y.tab.c:187
void yyerror(char *s)
Definition: lex.yy.c:2271
void sqpOrderColumn(char *col, int dir)
Definition: sql.c:200
yytype_int16 * yyssp
Definition: y.tab.c:1359
#define ASC
Definition: y.tab.c:189
#define INTEGER
Definition: y.tab.c:181
#define YYACCEPT
Definition: y.tab.c:794
yy_symbol_value_print(yyoutput, yytype, yyvaluep)
#define NAME
Definition: y.tab.c:155
union YYSTYPE YYSTYPE
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: y.tab.c:435
Definition: y.tab.c:413
int yynerrs
Definition: y.tab.c:1316
short int yytype_int8
Definition: y.tab.c:260
int yylex(void)
#define YY_INITIAL_VALUE(Value)
Definition: y.tab.c:1309
goto yyreduce
Definition: y.tab.c:1553
#define YY_STACK_PRINT(Bottom, Top)
Definition: y.tab.c:958
#define INTNUM
Definition: y.tab.c:157
#define ALTER
Definition: y.tab.c:175
#define YYNTOKENS
Definition: y.tab.c:474
return NULL
Definition: dbfopen.c:1394
YYSTYPE const *const yyvaluep
Definition: y.tab.c:891
SQLPNODE * node
Definition: y.tab.c:204
#define SET
Definition: y.tab.c:171
#define YYEOF
Definition: y.tab.c:792
#define yypact_value_is_default(Yystate)
Definition: y.tab.c:741
#define YYCASE_(N, S)
yytype_int16 * yytop
Definition: y.tab.c:946
return yylen
Definition: y.tab.c:1050
#define YYSYNTAX_ERROR
#define SELECT
Definition: y.tab.c:163
Definition: y.tab.c:195
#define NULL_VALUE
Definition: y.tab.c:178
SQLPNODE * sqpNewExpressionNode(int oper, SQLPNODE *left, SQLPNODE *right)
Definition: sql.c:217
int yyn
Definition: y.tab.c:1368
#define YYSTACK_ALLOC
Definition: y.tab.c:377
goto yyreturn
Definition: y.tab.c:2194
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: y.tab.c:865
#define OR
Definition: y.tab.c:173
#define YYLAST
Definition: y.tab.c:471
#define AND
Definition: y.tab.c:172
void sqpAssignment(char *col, char *strval, int intval, double dblval, SQLPNODE *expval, int type)
Definition: sql.c:162
int yychar
Definition: y.tab.c:1301
#define FROM
Definition: y.tab.c:164
#define COMPARISON_OPERATOR
Definition: y.tab.c:154
goto yyerrlab
Definition: y.tab.c:1552
#define ADD
Definition: y.tab.c:159
int yyresult
Definition: y.tab.c:1369
YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate
Definition: y.tab.c:1543
unsigned short int yytype_uint16
Definition: y.tab.c:266
#define VARCHAR
Definition: y.tab.c:179
#define IS
Definition: y.tab.c:188
void sqpValue(char *strval, int intval, double dblval, int type)
Definition: sql.c:129
yytype_int16 * yyss
Definition: y.tab.c:1358
#define yytable_value_is_error(Yytable_value)
Definition: y.tab.c:744
#define YYABORT
Definition: y.tab.c:795
#define DROP
Definition: y.tab.c:160
#define YYLEX
Definition: y.tab.c:848
goto yysetstate
Definition: y.tab.c:1399
#define YYTRANSLATE(YYX)
Definition: y.tab.c:486
#define DATE
Definition: y.tab.c:184
void sqpCommand(int command)
Definition: sql.c:90
int yyi
Definition: y.tab.c:979