GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-bea8435a9e
sqlp.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.7.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38  especially those whose name start with YY_ or yy_. They are
39  private implementation details that can be changed or removed. */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42  infringing on user name space. This should be done even for local
43  variables, as they might otherwise be expanded by user macros.
44  There are some unavoidable exceptions within include files to
45  define necessary library symbols; they are noted "INFRINGES ON
46  USER NAME SPACE" below. */
47 
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30705
50 
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.7.5"
53 
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers. */
58 #define YYPURE 0
59 
60 /* Push parsers. */
61 #define YYPUSH 0
62 
63 /* Pull parsers. */
64 #define YYPULL 1
65 
66 
67 
68 
69 /* First part of user prologue. */
70 #line 21 "sqlp.y"
71 
72 #include <stdlib.h>
73 #include <string.h>
74 #include <math.h>
75 #include <grass/sqlp.h>
76 
77 #define YYDEBUG 1
78 #define YYERROR_VERBOSE 1
79 
80 
81 #line 82 "sqlp.tab.c"
82 
83 # ifndef YY_CAST
84 # ifdef __cplusplus
85 # define YY_CAST(Type, Val) static_cast<Type> (Val)
86 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
87 # else
88 # define YY_CAST(Type, Val) ((Type) (Val))
89 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
90 # endif
91 # endif
92 # ifndef YY_NULLPTR
93 # if defined __cplusplus
94 # if 201103L <= __cplusplus
95 # define YY_NULLPTR nullptr
96 # else
97 # define YY_NULLPTR 0
98 # endif
99 # else
100 # define YY_NULLPTR ((void*)0)
101 # endif
102 # endif
103 
104 #include "sqlp.tab.h"
105 /* Symbol kind. */
107 {
109  YYSYMBOL_YYEOF = 0, /* "end of file" */
110  YYSYMBOL_YYerror = 1, /* error */
111  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
112  YYSYMBOL_COMPARISON_OPERATOR = 3, /* COMPARISON_OPERATOR */
113  YYSYMBOL_NAME = 4, /* NAME */
114  YYSYMBOL_STRING = 5, /* STRING */
115  YYSYMBOL_INTNUM = 6, /* INTNUM */
116  YYSYMBOL_FLOATNUM = 7, /* FLOATNUM */
117  YYSYMBOL_ADD = 8, /* ADD */
118  YYSYMBOL_DROP = 9, /* DROP */
119  YYSYMBOL_COLUMN = 10, /* COLUMN */
120  YYSYMBOL_EQUAL = 11, /* EQUAL */
121  YYSYMBOL_SELECT = 12, /* SELECT */
122  YYSYMBOL_FROM = 13, /* FROM */
123  YYSYMBOL_WHERE = 14, /* WHERE */
124  YYSYMBOL_DELETE = 15, /* DELETE */
125  YYSYMBOL_INSERT = 16, /* INSERT */
126  YYSYMBOL_INTO = 17, /* INTO */
127  YYSYMBOL_VALUES = 18, /* VALUES */
128  YYSYMBOL_UPDATE = 19, /* UPDATE */
129  YYSYMBOL_SET = 20, /* SET */
130  YYSYMBOL_AND = 21, /* AND */
131  YYSYMBOL_OR = 22, /* OR */
132  YYSYMBOL_NOT = 23, /* NOT */
133  YYSYMBOL_ALTER = 24, /* ALTER */
134  YYSYMBOL_TABLE = 25, /* TABLE */
135  YYSYMBOL_CREATE = 26, /* CREATE */
136  YYSYMBOL_NULL_VALUE = 27, /* NULL_VALUE */
137  YYSYMBOL_VARCHAR = 28, /* VARCHAR */
138  YYSYMBOL_INT = 29, /* INT */
139  YYSYMBOL_INTEGER = 30, /* INTEGER */
140  YYSYMBOL_DOUBLE = 31, /* DOUBLE */
141  YYSYMBOL_PRECISION = 32, /* PRECISION */
142  YYSYMBOL_DATE = 33, /* DATE */
143  YYSYMBOL_TIME = 34, /* TIME */
144  YYSYMBOL_ORDER = 35, /* ORDER */
145  YYSYMBOL_BY = 36, /* BY */
146  YYSYMBOL_IS = 37, /* IS */
147  YYSYMBOL_ASC = 38, /* ASC */
148  YYSYMBOL_DESC = 39, /* DESC */
149  YYSYMBOL_40_ = 40, /* ';' */
150  YYSYMBOL_41_ = 41, /* '(' */
151  YYSYMBOL_42_ = 42, /* ')' */
152  YYSYMBOL_43_ = 43, /* ',' */
153  YYSYMBOL_44_ = 44, /* '*' */
154  YYSYMBOL_45_ = 45, /* '-' */
155  YYSYMBOL_46_ = 46, /* '+' */
156  YYSYMBOL_47_ = 47, /* '/' */
157  YYSYMBOL_YYACCEPT = 48, /* $accept */
158  YYSYMBOL_y_sql = 49, /* y_sql */
159  YYSYMBOL_y_alter = 50, /* y_alter */
160  YYSYMBOL_y_create = 51, /* y_create */
161  YYSYMBOL_y_drop = 52, /* y_drop */
162  YYSYMBOL_y_select = 53, /* y_select */
163  YYSYMBOL_y_delete = 54, /* y_delete */
164  YYSYMBOL_y_insert = 55, /* y_insert */
165  YYSYMBOL_y_update = 56, /* y_update */
166  YYSYMBOL_y_columndefs = 57, /* y_columndefs */
167  YYSYMBOL_y_columndef = 58, /* y_columndef */
168  YYSYMBOL_y_columns = 59, /* y_columns */
169  YYSYMBOL_y_column_list = 60, /* y_column_list */
170  YYSYMBOL_y_table = 61, /* y_table */
171  YYSYMBOL_y_values = 62, /* y_values */
172  YYSYMBOL_y_value_list = 63, /* y_value_list */
173  YYSYMBOL_y_assignments = 64, /* y_assignments */
174  YYSYMBOL_y_assignment = 65, /* y_assignment */
175  YYSYMBOL_y_condition = 66, /* y_condition */
176  YYSYMBOL_y_sub_condition = 67, /* y_sub_condition */
177  YYSYMBOL_y_sub_condition2 = 68, /* y_sub_condition2 */
178  YYSYMBOL_y_boolean = 69, /* y_boolean */
179  YYSYMBOL_y_comparison = 70, /* y_comparison */
180  YYSYMBOL_y_expression = 71, /* y_expression */
181  YYSYMBOL_y_product = 72, /* y_product */
182  YYSYMBOL_y_term = 73, /* y_term */
183  YYSYMBOL_y_atom = 74, /* y_atom */
184  YYSYMBOL_y_value = 75, /* y_value */
185  YYSYMBOL_y_column = 76, /* y_column */
186  YYSYMBOL_y_order = 77, /* y_order */
187  YYSYMBOL_y_order_asc = 78, /* y_order_asc */
188  YYSYMBOL_y_order_desc = 79 /* y_order_desc */
189 };
190 typedef enum yysymbol_kind_t yysymbol_kind_t;
191 
192 
193 /* Second part of user prologue. */
194 #line 88 "sqlp.y"
195 
196 
197 extern int yylex(void);
198 
199 
200 #line 201 "sqlp.tab.c"
201 
202 
203 #ifdef short
204 # undef short
205 #endif
206 
207 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
208  <limits.h> and (if available) <stdint.h> are included
209  so that the code can choose integer types of a good width. */
210 
211 #ifndef __PTRDIFF_MAX__
212 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
213 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
214 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
215 # define YY_STDINT_H
216 # endif
217 #endif
218 
219 /* Narrow types that promote to a signed type and that can represent a
220  signed or unsigned integer of at least N bits. In tables they can
221  save space and decrease cache pressure. Promoting to a signed type
222  helps avoid bugs in integer arithmetic. */
223 
224 #ifdef __INT_LEAST8_MAX__
225 typedef __INT_LEAST8_TYPE__ yytype_int8;
226 #elif defined YY_STDINT_H
227 typedef int_least8_t yytype_int8;
228 #else
229 typedef signed char yytype_int8;
230 #endif
231 
232 #ifdef __INT_LEAST16_MAX__
233 typedef __INT_LEAST16_TYPE__ yytype_int16;
234 #elif defined YY_STDINT_H
235 typedef int_least16_t yytype_int16;
236 #else
237 typedef short yytype_int16;
238 #endif
239 
240 /* Work around bug in HP-UX 11.23, which defines these macros
241  incorrectly for preprocessor constants. This workaround can likely
242  be removed in 2023, as HPE has promised support for HP-UX 11.23
243  (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
244  <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
245 #ifdef __hpux
246 # undef UINT_LEAST8_MAX
247 # undef UINT_LEAST16_MAX
248 # define UINT_LEAST8_MAX 255
249 # define UINT_LEAST16_MAX 65535
250 #endif
251 
252 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
253 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
254 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
255  && UINT_LEAST8_MAX <= INT_MAX)
256 typedef uint_least8_t yytype_uint8;
257 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
258 typedef unsigned char yytype_uint8;
259 #else
260 typedef short yytype_uint8;
261 #endif
262 
263 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
264 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
265 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
266  && UINT_LEAST16_MAX <= INT_MAX)
267 typedef uint_least16_t yytype_uint16;
268 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
269 typedef unsigned short yytype_uint16;
270 #else
271 typedef int yytype_uint16;
272 #endif
273 
274 #ifndef YYPTRDIFF_T
275 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
276 # define YYPTRDIFF_T __PTRDIFF_TYPE__
277 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
278 # elif defined PTRDIFF_MAX
279 # ifndef ptrdiff_t
280 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
281 # endif
282 # define YYPTRDIFF_T ptrdiff_t
283 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
284 # else
285 # define YYPTRDIFF_T long
286 # define YYPTRDIFF_MAXIMUM LONG_MAX
287 # endif
288 #endif
289 
290 #ifndef YYSIZE_T
291 # ifdef __SIZE_TYPE__
292 # define YYSIZE_T __SIZE_TYPE__
293 # elif defined size_t
294 # define YYSIZE_T size_t
295 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
296 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
297 # define YYSIZE_T size_t
298 # else
299 # define YYSIZE_T unsigned
300 # endif
301 #endif
302 
303 #define YYSIZE_MAXIMUM \
304  YY_CAST (YYPTRDIFF_T, \
305  (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
306  ? YYPTRDIFF_MAXIMUM \
307  : YY_CAST (YYSIZE_T, -1)))
308 
309 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
310 
311 
312 /* Stored state numbers (used for stacks). */
314 
315 /* State numbers in computations. */
316 typedef int yy_state_fast_t;
317 
318 #ifndef YY_
319 # if defined YYENABLE_NLS && YYENABLE_NLS
320 # if ENABLE_NLS
321 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
322 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
323 # endif
324 # endif
325 # ifndef YY_
326 # define YY_(Msgid) Msgid
327 # endif
328 #endif
329 
330 
331 #ifndef YY_ATTRIBUTE_PURE
332 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
333 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
334 # else
335 # define YY_ATTRIBUTE_PURE
336 # endif
337 #endif
338 
339 #ifndef YY_ATTRIBUTE_UNUSED
340 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
341 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
342 # else
343 # define YY_ATTRIBUTE_UNUSED
344 # endif
345 #endif
346 
347 /* Suppress unused-variable warnings by "using" E. */
348 #if ! defined lint || defined __GNUC__
349 # define YY_USE(E) ((void) (E))
350 #else
351 # define YY_USE(E) /* empty */
352 #endif
353 
354 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
355 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
356 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
357  _Pragma ("GCC diagnostic push") \
358  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
359  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
360 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
361  _Pragma ("GCC diagnostic pop")
362 #else
363 # define YY_INITIAL_VALUE(Value) Value
364 #endif
365 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
366 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
367 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
368 #endif
369 #ifndef YY_INITIAL_VALUE
370 # define YY_INITIAL_VALUE(Value) /* Nothing. */
371 #endif
372 
373 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
374 # define YY_IGNORE_USELESS_CAST_BEGIN \
375  _Pragma ("GCC diagnostic push") \
376  _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
377 # define YY_IGNORE_USELESS_CAST_END \
378  _Pragma ("GCC diagnostic pop")
379 #endif
380 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
381 # define YY_IGNORE_USELESS_CAST_BEGIN
382 # define YY_IGNORE_USELESS_CAST_END
383 #endif
384 
385 
386 #define YY_ASSERT(E) ((void) (0 && (E)))
387 
388 #if !defined yyoverflow
389 
390 /* The parser invokes alloca or malloc; define the necessary symbols. */
391 
392 # ifdef YYSTACK_USE_ALLOCA
393 # if YYSTACK_USE_ALLOCA
394 # ifdef __GNUC__
395 # define YYSTACK_ALLOC __builtin_alloca
396 # elif defined __BUILTIN_VA_ARG_INCR
397 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
398 # elif defined _AIX
399 # define YYSTACK_ALLOC __alloca
400 # elif defined _MSC_VER
401 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
402 # define alloca _alloca
403 # else
404 # define YYSTACK_ALLOC alloca
405 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
406 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
407  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
408 # ifndef EXIT_SUCCESS
409 # define EXIT_SUCCESS 0
410 # endif
411 # endif
412 # endif
413 # endif
414 # endif
415 
416 # ifdef YYSTACK_ALLOC
417  /* Pacify GCC's 'empty if-body' warning. */
418 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
419 # ifndef YYSTACK_ALLOC_MAXIMUM
420  /* The OS might guarantee only one guard page at the bottom of the stack,
421  and a page size can be as small as 4096 bytes. So we cannot safely
422  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
423  to allow for a few compiler-allocated temporary stack slots. */
424 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
425 # endif
426 # else
427 # define YYSTACK_ALLOC YYMALLOC
428 # define YYSTACK_FREE YYFREE
429 # ifndef YYSTACK_ALLOC_MAXIMUM
430 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
431 # endif
432 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
433  && ! ((defined YYMALLOC || defined malloc) \
434  && (defined YYFREE || defined free)))
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
436 # ifndef EXIT_SUCCESS
437 # define EXIT_SUCCESS 0
438 # endif
439 # endif
440 # ifndef YYMALLOC
441 # define YYMALLOC malloc
442 # if ! defined malloc && ! defined EXIT_SUCCESS
443 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
444 # endif
445 # endif
446 # ifndef YYFREE
447 # define YYFREE free
448 # if ! defined free && ! defined EXIT_SUCCESS
449 void free (void *); /* INFRINGES ON USER NAME SPACE */
450 # endif
451 # endif
452 # endif
453 #endif /* !defined yyoverflow */
454 
455 #if (! defined yyoverflow \
456  && (! defined __cplusplus \
457  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
458 
459 /* A type that is properly aligned for any stack member. */
460 union yyalloc
461 {
462  yy_state_t yyss_alloc;
463  YYSTYPE yyvs_alloc;
464 };
465 
466 /* The size of the maximum gap between one aligned stack and the next. */
467 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
468 
469 /* The size of an array large to enough to hold all stacks, each with
470  N elements. */
471 # define YYSTACK_BYTES(N) \
472  ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
473  + YYSTACK_GAP_MAXIMUM)
474 
475 # define YYCOPY_NEEDED 1
476 
477 /* Relocate STACK from its old location to the new one. The
478  local variables YYSIZE and YYSTACKSIZE give the old and new number of
479  elements in the stack, and YYPTR gives the new location of the
480  stack. Advance YYPTR to a properly aligned location for the next
481  stack. */
482 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
483  do \
484  { \
485  YYPTRDIFF_T yynewbytes; \
486  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
487  Stack = &yyptr->Stack_alloc; \
488  yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
489  yyptr += yynewbytes / YYSIZEOF (*yyptr); \
490  } \
491  while (0)
492 
493 #endif
494 
495 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
496 /* Copy COUNT objects from SRC to DST. The source and destination do
497  not overlap. */
498 # ifndef YYCOPY
499 # if defined __GNUC__ && 1 < __GNUC__
500 # define YYCOPY(Dst, Src, Count) \
501  __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
502 # else
503 # define YYCOPY(Dst, Src, Count) \
504  do \
505  { \
506  YYPTRDIFF_T yyi; \
507  for (yyi = 0; yyi < (Count); yyi++) \
508  (Dst)[yyi] = (Src)[yyi]; \
509  } \
510  while (0)
511 # endif
512 # endif
513 #endif /* !YYCOPY_NEEDED */
514 
515 /* YYFINAL -- State number of the termination state. */
516 #define YYFINAL 27
517 /* YYLAST -- Last index in YYTABLE. */
518 #define YYLAST 156
519 
520 /* YYNTOKENS -- Number of terminals. */
521 #define YYNTOKENS 48
522 /* YYNNTS -- Number of nonterminals. */
523 #define YYNNTS 32
524 /* YYNRULES -- Number of rules. */
525 #define YYNRULES 87
526 /* YYNSTATES -- Number of states. */
527 #define YYNSTATES 157
528 
529 /* YYMAXUTOK -- Last valid token kind. */
530 #define YYMAXUTOK 294
531 
532 
533 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
534  as returned by yylex, with out-of-bounds checking. */
535 #define YYTRANSLATE(YYX) \
536  (0 <= (YYX) && (YYX) <= YYMAXUTOK \
537  ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
538  : YYSYMBOL_YYUNDEF)
539 
540 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
541  as returned by yylex. */
542 static const yytype_int8 yytranslate[] =
543 {
544  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548  41, 42, 44, 46, 43, 45, 2, 47, 2, 2,
549  2, 2, 2, 2, 2, 2, 2, 2, 2, 40,
550  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
570  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
571  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
572  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
573  35, 36, 37, 38, 39
574 };
575 
576 #if YYDEBUG
577  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
578 static const yytype_int16 yyrline[] =
579 {
580  0, 97, 97, 98, 99, 100, 101, 102, 103, 104,
581  108, 109, 110, 114, 118, 122, 123, 124, 125, 129,
582  130, 134, 135, 139, 140, 145, 146, 150, 151, 152,
583  153, 154, 155, 156, 160, 161, 165, 166, 170, 174,
584  178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
585  188, 189, 193, 194, 198, 202, 206, 213, 214, 218,
586  219, 223, 224, 225, 230, 233, 236, 239, 246, 247,
587  250, 256, 257, 260, 266, 267, 273, 274, 275, 280,
588  281, 282, 287, 290, 290, 293, 294, 297
589 };
590 #endif
591 
592 /** Accessing symbol of state STATE. */
593 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
594 
595 #if YYDEBUG || 0
596 /* The user-facing name of the symbol whose (internal) number is
597  YYSYMBOL. No bounds checking. */
598 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
599 
600 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
601  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
602 static const char *const yytname[] =
603 {
604  "\"end of file\"", "error", "\"invalid token\"", "COMPARISON_OPERATOR",
605  "NAME", "STRING", "INTNUM", "FLOATNUM", "ADD", "DROP", "COLUMN", "EQUAL",
606  "SELECT", "FROM", "WHERE", "DELETE", "INSERT", "INTO", "VALUES",
607  "UPDATE", "SET", "AND", "OR", "NOT", "ALTER", "TABLE", "CREATE",
608  "NULL_VALUE", "VARCHAR", "INT", "INTEGER", "DOUBLE", "PRECISION", "DATE",
609  "TIME", "ORDER", "BY", "IS", "ASC", "DESC", "';'", "'('", "')'", "','",
610  "'*'", "'-'", "'+'", "'/'", "$accept", "y_sql", "y_alter", "y_create",
611  "y_drop", "y_select", "y_delete", "y_insert", "y_update", "y_columndefs",
612  "y_columndef", "y_columns", "y_column_list", "y_table", "y_values",
613  "y_value_list", "y_assignments", "y_assignment", "y_condition",
614  "y_sub_condition", "y_sub_condition2", "y_boolean", "y_comparison",
615  "y_expression", "y_product", "y_term", "y_atom", "y_value", "y_column",
616  "y_order", "y_order_asc", "y_order_desc", YY_NULLPTR
617 };
618 
619 static const char *
620 yysymbol_name (yysymbol_kind_t yysymbol)
621 {
622  return yytname[yysymbol];
623 }
624 #endif
625 
626 #ifdef YYPRINT
627 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
628  (internal) symbol number NUM (which must be that of a token). */
629 static const yytype_int16 yytoknum[] =
630 {
631  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
632  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
633  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
634  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
635  59, 40, 41, 44, 42, 45, 43, 47
636 };
637 #endif
638 
639 #define YYPACT_NINF (-52)
640 
641 #define yypact_value_is_default(Yyn) \
642  ((Yyn) == YYPACT_NINF)
643 
644 #define YYTABLE_NINF (-1)
645 
646 #define yytable_value_is_error(Yyn) \
647  0
648 
649  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
650  STATE-NUM. */
651 static const yytype_int16 yypact[] =
652 {
653  64, -8, 3, 11, 5, 32, 49, 57, 2, -52,
654  -52, -52, -52, -52, -52, -52, 32, -52, -52, 39,
655  41, 32, 32, -52, 102, 32, 32, -52, -52, -52,
656  32, 85, 109, 7, 95, 10, 83, 37, -52, 8,
657  84, 3, -52, 115, -10, -52, 6, 117, 124, 8,
658  93, -52, -52, -52, -52, 8, 8, 55, -52, 108,
659  110, -52, -52, 0, 31, -52, -52, -52, -52, 23,
660  90, 50, 8, 95, 79, 124, -52, 129, 24, -52,
661  99, 131, -52, -16, -2, 55, -52, 8, 8, 55,
662  55, 111, 113, 55, 55, 55, 55, -52, -52, -52,
663  -52, 80, 51, 118, -52, 59, -52, -52, 96, -52,
664  -52, 107, -52, -52, -52, -52, -52, 124, 105, 78,
665  -52, -52, -52, -52, -52, 69, 110, -52, 59, 59,
666  -52, -52, 31, 31, -52, -52, -52, -52, -52, 58,
667  -52, 136, -52, -52, 131, -52, -52, -52, -52, -52,
668  -52, 112, 101, -52, -52, -52, -52
669 };
670 
671  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
672  Performed when YYTABLE does not specify something else to do. Zero
673  means the default is an error. */
674 static const yytype_int8 yydefact[] =
675 {
676  0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
677  3, 4, 6, 8, 5, 7, 0, 36, 34, 0,
678  35, 0, 0, 38, 0, 0, 0, 1, 9, 14,
679  0, 0, 19, 0, 0, 0, 0, 15, 37, 0,
680  0, 0, 21, 0, 23, 52, 0, 0, 0, 0,
681  0, 82, 79, 80, 81, 0, 0, 0, 20, 56,
682  57, 59, 61, 0, 68, 71, 74, 76, 77, 0,
683  0, 0, 0, 0, 0, 0, 11, 0, 0, 25,
684  16, 0, 63, 0, 0, 0, 75, 0, 0, 0,
685  0, 0, 0, 0, 0, 0, 0, 41, 42, 44,
686  40, 0, 0, 0, 54, 55, 24, 53, 0, 28,
687  29, 30, 32, 33, 10, 12, 13, 0, 0, 85,
688  17, 83, 84, 62, 78, 0, 58, 60, 65, 64,
689  67, 66, 70, 69, 72, 73, 43, 45, 39, 0,
690  22, 0, 31, 26, 0, 86, 87, 47, 48, 50,
691  46, 0, 0, 18, 49, 51, 27
692 };
693 
694  /* YYPGOTO[NTERM-NUM]. */
695 static const yytype_int8 yypgoto[] =
696 {
697  -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
698  -48, 103, -52, 76, 42, -52, -52, 73, 9, 91,
699  61, -47, -52, -51, 27, -25, -52, -52, -52, 12,
700  -52, -52
701 };
702 
703  /* YYDEFGOTO[NTERM-NUM]. */
704 static const yytype_int8 yydefgoto[] =
705 {
706  0, 8, 9, 10, 11, 12, 13, 14, 15, 78,
707  76, 19, 20, 24, 42, 102, 44, 45, 58, 59,
708  60, 61, 62, 63, 64, 65, 66, 67, 68, 120,
709  121, 122
710 };
711 
712  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
713  positive, shift that token. If negative, reduce the rule whose
714  number is the opposite. If YYTABLE_NINF, syntax error. */
715 static const yytype_uint8 yytable[] =
716 {
717  79, 89, 27, 89, 72, 84, 87, 17, 82, 90,
718  74, 90, 51, 52, 53, 54, 75, 16, 46, 47,
719  105, 91, 22, 91, 21, 40, 123, 114, 97, 98,
720  99, 55, 86, 73, 125, 92, 23, 92, 128, 129,
721  124, 127, 28, 93, 94, 93, 94, 18, 41, 56,
722  100, 49, 30, 57, 51, 52, 53, 54, 80, 51,
723  52, 53, 54, 147, 148, 149, 116, 117, 101, 143,
724  134, 135, 50, 1, 25, 95, 2, 104, 96, 3,
725  4, 106, 26, 5, 31, 150, 136, 137, 6, 38,
726  7, 85, 29, 138, 139, 57, 85, 32, 33, 43,
727  57, 35, 36, 151, 93, 94, 37, 108, 109, 110,
728  111, 124, 112, 113, 93, 94, 145, 146, 154, 155,
729  132, 133, 34, 39, 48, 69, 71, 77, 74, 81,
730  87, 88, 103, 115, 118, 119, 40, 141, 130, 142,
731  131, 144, 152, 156, 70, 140, 107, 83, 126, 0,
732  0, 0, 0, 0, 0, 0, 153
733 };
734 
735 static const yytype_int16 yycheck[] =
736 {
737  48, 3, 0, 3, 14, 56, 22, 4, 55, 11,
738  4, 11, 4, 5, 6, 7, 10, 25, 8, 9,
739  71, 23, 17, 23, 13, 18, 42, 75, 5, 6,
740  7, 23, 57, 43, 85, 37, 4, 37, 89, 90,
741  42, 88, 40, 45, 46, 45, 46, 44, 41, 41,
742  27, 14, 13, 45, 4, 5, 6, 7, 49, 4,
743  5, 6, 7, 5, 6, 7, 42, 43, 45, 117,
744  95, 96, 35, 9, 25, 44, 12, 27, 47, 15,
745  16, 72, 25, 19, 43, 27, 6, 7, 24, 4,
746  26, 41, 16, 42, 43, 45, 41, 21, 22, 4,
747  45, 25, 26, 45, 45, 46, 30, 28, 29, 30,
748  31, 42, 33, 34, 45, 46, 38, 39, 6, 7,
749  93, 94, 20, 14, 41, 41, 11, 10, 4, 36,
750  22, 21, 42, 4, 35, 4, 18, 41, 27, 32,
751  27, 36, 6, 42, 41, 103, 73, 56, 87, -1,
752  -1, -1, -1, -1, -1, -1, 144
753 };
754 
755  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
756  symbol of state STATE-NUM. */
757 static const yytype_int8 yystos[] =
758 {
759  0, 9, 12, 15, 16, 19, 24, 26, 49, 50,
760  51, 52, 53, 54, 55, 56, 25, 4, 44, 59,
761  60, 13, 17, 4, 61, 25, 25, 0, 40, 61,
762  13, 43, 61, 61, 20, 61, 61, 61, 4, 14,
763  18, 41, 62, 4, 64, 65, 8, 9, 41, 14,
764  35, 4, 5, 6, 7, 23, 41, 45, 66, 67,
765  68, 69, 70, 71, 72, 73, 74, 75, 76, 41,
766  59, 11, 14, 43, 4, 10, 58, 10, 57, 58,
767  66, 36, 69, 67, 71, 41, 73, 22, 21, 3,
768  11, 23, 37, 45, 46, 44, 47, 5, 6, 7,
769  27, 45, 63, 42, 27, 71, 66, 65, 28, 29,
770  30, 31, 33, 34, 58, 4, 42, 43, 35, 4,
771  77, 78, 79, 42, 42, 71, 68, 69, 71, 71,
772  27, 27, 72, 72, 73, 73, 6, 7, 42, 43,
773  62, 41, 32, 58, 36, 38, 39, 5, 6, 7,
774  27, 45, 6, 77, 6, 7, 42
775 };
776 
777  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
778 static const yytype_int8 yyr1[] =
779 {
780  0, 48, 49, 49, 49, 49, 49, 49, 49, 49,
781  50, 50, 50, 51, 52, 53, 53, 53, 53, 54,
782  54, 55, 55, 56, 56, 57, 57, 58, 58, 58,
783  58, 58, 58, 58, 59, 59, 60, 60, 61, 62,
784  63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
785  63, 63, 64, 64, 65, 65, 66, 67, 67, 68,
786  68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
787  71, 72, 72, 72, 73, 73, 74, 74, 74, 75,
788  75, 75, 76, 77, 77, 78, 78, 79
789 };
790 
791  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
792 static const yytype_int8 yyr2[] =
793 {
794  0, 2, 1, 1, 1, 1, 1, 1, 1, 2,
795  6, 5, 6, 6, 3, 4, 6, 7, 9, 3,
796  5, 4, 7, 4, 6, 1, 3, 5, 2, 2,
797  2, 3, 2, 2, 1, 1, 1, 3, 1, 4,
798  1, 1, 1, 2, 1, 2, 3, 3, 3, 4,
799  3, 4, 1, 3, 3, 3, 1, 1, 3, 1,
800  3, 1, 3, 2, 3, 3, 3, 3, 1, 3,
801  3, 1, 3, 3, 1, 2, 1, 1, 3, 1,
802  1, 1, 1, 1, 1, 1, 2, 2
803 };
804 
805 
806 enum { YYENOMEM = -2 };
807 
808 #define yyerrok (yyerrstatus = 0)
809 #define yyclearin (yychar = YYEMPTY)
810 
811 #define YYACCEPT goto yyacceptlab
812 #define YYABORT goto yyabortlab
813 #define YYERROR goto yyerrorlab
814 
815 
816 #define YYRECOVERING() (!!yyerrstatus)
817 
818 #define YYBACKUP(Token, Value) \
819  do \
820  if (yychar == YYEMPTY) \
821  { \
822  yychar = (Token); \
823  yylval = (Value); \
824  YYPOPSTACK (yylen); \
825  yystate = *yyssp; \
826  goto yybackup; \
827  } \
828  else \
829  { \
830  yyerror (YY_("syntax error: cannot back up")); \
831  YYERROR; \
832  } \
833  while (0)
834 
835 /* Backward compatibility with an undocumented macro.
836  Use YYerror or YYUNDEF. */
837 #define YYERRCODE YYUNDEF
838 
839 
840 /* Enable debugging if requested. */
841 #if YYDEBUG
842 
843 # ifndef YYFPRINTF
844 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
845 # define YYFPRINTF fprintf
846 # endif
847 
848 # define YYDPRINTF(Args) \
849 do { \
850  if (yydebug) \
851  YYFPRINTF Args; \
852 } while (0)
853 
854 /* This macro is provided for backward compatibility. */
855 # ifndef YY_LOCATION_PRINT
856 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
857 # endif
858 
859 
860 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
861 do { \
862  if (yydebug) \
863  { \
864  YYFPRINTF (stderr, "%s ", Title); \
865  yy_symbol_print (stderr, \
866  Kind, Value); \
867  YYFPRINTF (stderr, "\n"); \
868  } \
869 } while (0)
870 
871 
872 /*-----------------------------------.
873 | Print this symbol's value on YYO. |
874 `-----------------------------------*/
875 
876 static void
877 yy_symbol_value_print (FILE *yyo,
878  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
879 {
880  FILE *yyoutput = yyo;
881  YY_USE (yyoutput);
882  if (!yyvaluep)
883  return;
884 # ifdef YYPRINT
885  if (yykind < YYNTOKENS)
886  YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
887 # endif
889  YY_USE (yykind);
891 }
892 
893 
894 /*---------------------------.
895 | Print this symbol on YYO. |
896 `---------------------------*/
897 
898 static void
899 yy_symbol_print (FILE *yyo,
900  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
901 {
902  YYFPRINTF (yyo, "%s %s (",
903  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
904 
905  yy_symbol_value_print (yyo, yykind, yyvaluep);
906  YYFPRINTF (yyo, ")");
907 }
908 
909 /*------------------------------------------------------------------.
910 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
911 | TOP (included). |
912 `------------------------------------------------------------------*/
913 
914 static void
915 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
916 {
917  YYFPRINTF (stderr, "Stack now");
918  for (; yybottom <= yytop; yybottom++)
919  {
920  int yybot = *yybottom;
921  YYFPRINTF (stderr, " %d", yybot);
922  }
923  YYFPRINTF (stderr, "\n");
924 }
925 
926 # define YY_STACK_PRINT(Bottom, Top) \
927 do { \
928  if (yydebug) \
929  yy_stack_print ((Bottom), (Top)); \
930 } while (0)
931 
932 
933 /*------------------------------------------------.
934 | Report that the YYRULE is going to be reduced. |
935 `------------------------------------------------*/
936 
937 static void
938 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
939  int yyrule)
940 {
941  int yylno = yyrline[yyrule];
942  int yynrhs = yyr2[yyrule];
943  int yyi;
944  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
945  yyrule - 1, yylno);
946  /* The symbols being reduced. */
947  for (yyi = 0; yyi < yynrhs; yyi++)
948  {
949  YYFPRINTF (stderr, " $%d = ", yyi + 1);
950  yy_symbol_print (stderr,
951  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
952  &yyvsp[(yyi + 1) - (yynrhs)]);
953  YYFPRINTF (stderr, "\n");
954  }
955 }
956 
957 # define YY_REDUCE_PRINT(Rule) \
958 do { \
959  if (yydebug) \
960  yy_reduce_print (yyssp, yyvsp, Rule); \
961 } while (0)
962 
963 /* Nonzero means print parse trace. It is left uninitialized so that
964  multiple parsers can coexist. */
966 #else /* !YYDEBUG */
967 # define YYDPRINTF(Args) ((void) 0)
968 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
969 # define YY_STACK_PRINT(Bottom, Top)
970 # define YY_REDUCE_PRINT(Rule)
971 #endif /* !YYDEBUG */
972 
973 
974 /* YYINITDEPTH -- initial size of the parser's stacks. */
975 #ifndef YYINITDEPTH
976 # define YYINITDEPTH 200
977 #endif
978 
979 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
980  if the built-in stack extension method is used).
981 
982  Do not make this value too large; the results are undefined if
983  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
984  evaluated with infinite-precision integer arithmetic. */
985 
986 #ifndef YYMAXDEPTH
987 # define YYMAXDEPTH 10000
988 #endif
989 
990 
991 
992 
993 
994 
995 /*-----------------------------------------------.
996 | Release the memory associated to this symbol. |
997 `-----------------------------------------------*/
998 
999 static void
1000 yydestruct (const char *yymsg,
1001  yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1002 {
1003  YY_USE (yyvaluep);
1004  if (!yymsg)
1005  yymsg = "Deleting";
1006  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1007 
1009  YY_USE (yykind);
1011 }
1012 
1013 
1014 /* Lookahead token kind. */
1016 
1017 /* The semantic value of the lookahead symbol. */
1019 /* Number of syntax errors so far. */
1021 
1022 
1023 
1024 
1025 /*----------.
1026 | yyparse. |
1027 `----------*/
1028 
1029 int
1030 yyparse (void)
1031 {
1032  yy_state_fast_t yystate = 0;
1033  /* Number of tokens to shift before error messages enabled. */
1034  int yyerrstatus = 0;
1035 
1036  /* Refer to the stacks through separate pointers, to allow yyoverflow
1037  to reallocate them elsewhere. */
1038 
1039  /* Their size. */
1040  YYPTRDIFF_T yystacksize = YYINITDEPTH;
1041 
1042  /* The state stack: array, bottom, top. */
1043  yy_state_t yyssa[YYINITDEPTH];
1044  yy_state_t *yyss = yyssa;
1045  yy_state_t *yyssp = yyss;
1046 
1047  /* The semantic value stack: array, bottom, top. */
1048  YYSTYPE yyvsa[YYINITDEPTH];
1049  YYSTYPE *yyvs = yyvsa;
1050  YYSTYPE *yyvsp = yyvs;
1051 
1052  int yyn;
1053  /* The return value of yyparse. */
1054  int yyresult;
1055  /* Lookahead symbol kind. */
1057  /* The variables used to return semantic value and location from the
1058  action routines. */
1059  YYSTYPE yyval;
1060 
1061 
1062 
1063 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1064 
1065  /* The number of symbols on the RHS of the reduced rule.
1066  Keep to zero when no symbol should be popped. */
1067  int yylen = 0;
1068 
1069  YYDPRINTF ((stderr, "Starting parse\n"));
1070 
1071  yychar = YYEMPTY; /* Cause a token to be read. */
1072  goto yysetstate;
1073 
1074 
1075 /*------------------------------------------------------------.
1076 | yynewstate -- push a new state, which is found in yystate. |
1077 `------------------------------------------------------------*/
1078 yynewstate:
1079  /* In all cases, when you get here, the value and location stacks
1080  have just been pushed. So pushing a state here evens the stacks. */
1081  yyssp++;
1082 
1083 
1084 /*--------------------------------------------------------------------.
1085 | yysetstate -- set current state (the top of the stack) to yystate. |
1086 `--------------------------------------------------------------------*/
1087 yysetstate:
1088  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1089  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1091  *yyssp = YY_CAST (yy_state_t, yystate);
1093  YY_STACK_PRINT (yyss, yyssp);
1094 
1095  if (yyss + yystacksize - 1 <= yyssp)
1096 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1097  goto yyexhaustedlab;
1098 #else
1099  {
1100  /* Get the current used size of the three stacks, in elements. */
1101  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1102 
1103 # if defined yyoverflow
1104  {
1105  /* Give user a chance to reallocate the stack. Use copies of
1106  these so that the &'s don't force the real ones into
1107  memory. */
1108  yy_state_t *yyss1 = yyss;
1109  YYSTYPE *yyvs1 = yyvs;
1110 
1111  /* Each stack pointer address is followed by the size of the
1112  data in use in that stack, in bytes. This used to be a
1113  conditional around just the two extra args, but that might
1114  be undefined if yyoverflow is a macro. */
1115  yyoverflow (YY_("memory exhausted"),
1116  &yyss1, yysize * YYSIZEOF (*yyssp),
1117  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1118  &yystacksize);
1119  yyss = yyss1;
1120  yyvs = yyvs1;
1121  }
1122 # else /* defined YYSTACK_RELOCATE */
1123  /* Extend the stack our own way. */
1124  if (YYMAXDEPTH <= yystacksize)
1125  goto yyexhaustedlab;
1126  yystacksize *= 2;
1127  if (YYMAXDEPTH < yystacksize)
1128  yystacksize = YYMAXDEPTH;
1129 
1130  {
1131  yy_state_t *yyss1 = yyss;
1132  union yyalloc *yyptr =
1133  YY_CAST (union yyalloc *,
1134  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1135  if (! yyptr)
1136  goto yyexhaustedlab;
1137  YYSTACK_RELOCATE (yyss_alloc, yyss);
1138  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1139 # undef YYSTACK_RELOCATE
1140  if (yyss1 != yyssa)
1141  YYSTACK_FREE (yyss1);
1142  }
1143 # endif
1144 
1145  yyssp = yyss + yysize - 1;
1146  yyvsp = yyvs + yysize - 1;
1147 
1149  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1150  YY_CAST (long, yystacksize)));
1152 
1153  if (yyss + yystacksize - 1 <= yyssp)
1154  YYABORT;
1155  }
1156 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1157 
1158  if (yystate == YYFINAL)
1159  YYACCEPT;
1160 
1161  goto yybackup;
1162 
1163 
1164 /*-----------.
1165 | yybackup. |
1166 `-----------*/
1167 yybackup:
1168  /* Do appropriate processing given the current state. Read a
1169  lookahead token if we need one and don't already have one. */
1170 
1171  /* First try to decide what to do without reference to lookahead token. */
1172  yyn = yypact[yystate];
1173  if (yypact_value_is_default (yyn))
1174  goto yydefault;
1175 
1176  /* Not known => get a lookahead token if don't already have one. */
1177 
1178  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1179  if (yychar == YYEMPTY)
1180  {
1181  YYDPRINTF ((stderr, "Reading a token\n"));
1182  yychar = yylex ();
1183  }
1184 
1185  if (yychar <= YYEOF)
1186  {
1187  yychar = YYEOF;
1188  yytoken = YYSYMBOL_YYEOF;
1189  YYDPRINTF ((stderr, "Now at end of input.\n"));
1190  }
1191  else if (yychar == YYerror)
1192  {
1193  /* The scanner already issued an error message, process directly
1194  to error recovery. But do not keep the error token as
1195  lookahead, it is too special and may lead us to an endless
1196  loop in error recovery. */
1197  yychar = YYUNDEF;
1198  yytoken = YYSYMBOL_YYerror;
1199  goto yyerrlab1;
1200  }
1201  else
1202  {
1203  yytoken = YYTRANSLATE (yychar);
1204  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1205  }
1206 
1207  /* If the proper action on seeing token YYTOKEN is to reduce or to
1208  detect an error, take that action. */
1209  yyn += yytoken;
1210  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1211  goto yydefault;
1212  yyn = yytable[yyn];
1213  if (yyn <= 0)
1214  {
1215  if (yytable_value_is_error (yyn))
1216  goto yyerrlab;
1217  yyn = -yyn;
1218  goto yyreduce;
1219  }
1220 
1221  /* Count tokens shifted since error; after three, turn off error
1222  status. */
1223  if (yyerrstatus)
1224  yyerrstatus--;
1225 
1226  /* Shift the lookahead token. */
1227  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1228  yystate = yyn;
1230  *++yyvsp = yylval;
1232 
1233  /* Discard the shifted token. */
1234  yychar = YYEMPTY;
1235  goto yynewstate;
1236 
1237 
1238 /*-----------------------------------------------------------.
1239 | yydefault -- do the default action for the current state. |
1240 `-----------------------------------------------------------*/
1241 yydefault:
1242  yyn = yydefact[yystate];
1243  if (yyn == 0)
1244  goto yyerrlab;
1245  goto yyreduce;
1246 
1247 
1248 /*-----------------------------.
1249 | yyreduce -- do a reduction. |
1250 `-----------------------------*/
1251 yyreduce:
1252  /* yyn is the number of a rule to reduce with. */
1253  yylen = yyr2[yyn];
1254 
1255  /* If YYLEN is nonzero, implement the default value of the action:
1256  '$$ = $1'.
1257 
1258  Otherwise, the following line sets YYVAL to garbage.
1259  This behavior is undocumented and Bison
1260  users should not rely upon it. Assigning to YYVAL
1261  unconditionally makes the parser a bit smaller, and it avoids a
1262  GCC warning that YYVAL may be used uninitialized. */
1263  yyval = yyvsp[1-yylen];
1264 
1265 
1266  YY_REDUCE_PRINT (yyn);
1267  switch (yyn)
1268  {
1269  case 10: /* y_alter: ALTER TABLE y_table ADD COLUMN y_columndef */
1270 #line 108 "sqlp.y"
1272 #line 1273 "sqlp.tab.c"
1273  break;
1274 
1275  case 11: /* y_alter: ALTER TABLE y_table ADD y_columndef */
1276 #line 109 "sqlp.y"
1278 #line 1279 "sqlp.tab.c"
1279  break;
1280 
1281  case 12: /* y_alter: ALTER TABLE y_table DROP COLUMN NAME */
1282 #line 110 "sqlp.y"
1283  { sqpCommand(SQLP_DROP_COLUMN); sqpColumn((yyvsp[0].strval));}
1284 #line 1285 "sqlp.tab.c"
1285  break;
1286 
1287  case 13: /* y_create: CREATE TABLE y_table '(' y_columndefs ')' */
1288 #line 114 "sqlp.y"
1289  { sqpCommand(SQLP_CREATE); }
1290 #line 1291 "sqlp.tab.c"
1291  break;
1292 
1293  case 14: /* y_drop: DROP TABLE y_table */
1294 #line 118 "sqlp.y"
1295  { sqpCommand(SQLP_DROP); }
1296 #line 1297 "sqlp.tab.c"
1297  break;
1298 
1299  case 15: /* y_select: SELECT y_columns FROM y_table */
1300 #line 122 "sqlp.y"
1301  { sqpCommand(SQLP_SELECT); }
1302 #line 1303 "sqlp.tab.c"
1303  break;
1304 
1305  case 16: /* y_select: SELECT y_columns FROM y_table WHERE y_condition */
1306 #line 123 "sqlp.y"
1307  { sqpCommand(SQLP_SELECT); }
1308 #line 1309 "sqlp.tab.c"
1309  break;
1310 
1311  case 17: /* y_select: SELECT y_columns FROM y_table ORDER BY y_order */
1312 #line 124 "sqlp.y"
1313  { sqpCommand(SQLP_SELECT); }
1314 #line 1315 "sqlp.tab.c"
1315  break;
1316 
1317  case 18: /* y_select: SELECT y_columns FROM y_table WHERE y_condition ORDER BY y_order */
1318 #line 125 "sqlp.y"
1319  { sqpCommand(SQLP_SELECT); }
1320 #line 1321 "sqlp.tab.c"
1321  break;
1322 
1323  case 19: /* y_delete: DELETE FROM y_table */
1324 #line 129 "sqlp.y"
1325  { sqpCommand(SQLP_DELETE); }
1326 #line 1327 "sqlp.tab.c"
1327  break;
1328 
1329  case 20: /* y_delete: DELETE FROM y_table WHERE y_condition */
1330 #line 130 "sqlp.y"
1331  { sqpCommand(SQLP_DELETE); }
1332 #line 1333 "sqlp.tab.c"
1333  break;
1334 
1335  case 21: /* y_insert: INSERT INTO y_table y_values */
1336 #line 134 "sqlp.y"
1337  { sqpCommand(SQLP_INSERT); }
1338 #line 1339 "sqlp.tab.c"
1339  break;
1340 
1341  case 22: /* y_insert: INSERT INTO y_table '(' y_columns ')' y_values */
1342 #line 135 "sqlp.y"
1343  { sqpCommand(SQLP_INSERT); }
1344 #line 1345 "sqlp.tab.c"
1345  break;
1346 
1347  case 23: /* y_update: UPDATE y_table SET y_assignments */
1348 #line 139 "sqlp.y"
1349  { sqpCommand(SQLP_UPDATE); }
1350 #line 1351 "sqlp.tab.c"
1351  break;
1352 
1353  case 24: /* y_update: UPDATE y_table SET y_assignments WHERE y_condition */
1354 #line 140 "sqlp.y"
1355  { sqpCommand(SQLP_UPDATE); }
1356 #line 1357 "sqlp.tab.c"
1357  break;
1358 
1359  case 27: /* y_columndef: NAME VARCHAR '(' INTNUM ')' */
1360 #line 150 "sqlp.y"
1361  { sqpColumnDef( (yyvsp[-4].strval), SQLP_VARCHAR, (yyvsp[-1].intval), 0 ); }
1362 #line 1363 "sqlp.tab.c"
1363  break;
1364 
1365  case 28: /* y_columndef: NAME INT */
1366 #line 151 "sqlp.y"
1367  { sqpColumnDef( (yyvsp[-1].strval), SQLP_INTEGER, 0, 0 ); }
1368 #line 1369 "sqlp.tab.c"
1369  break;
1370 
1371  case 29: /* y_columndef: NAME INTEGER */
1372 #line 152 "sqlp.y"
1373  { sqpColumnDef( (yyvsp[-1].strval), SQLP_INTEGER, 0, 0 ); }
1374 #line 1375 "sqlp.tab.c"
1375  break;
1376 
1377  case 30: /* y_columndef: NAME DOUBLE */
1378 #line 153 "sqlp.y"
1379  { sqpColumnDef( (yyvsp[-1].strval), SQLP_DOUBLE, 0, 0 ); }
1380 #line 1381 "sqlp.tab.c"
1381  break;
1382 
1383  case 31: /* y_columndef: NAME DOUBLE PRECISION */
1384 #line 154 "sqlp.y"
1385  { sqpColumnDef( (yyvsp[-2].strval), SQLP_DOUBLE, 0, 0 ); }
1386 #line 1387 "sqlp.tab.c"
1387  break;
1388 
1389  case 32: /* y_columndef: NAME DATE */
1390 #line 155 "sqlp.y"
1391  { sqpColumnDef( (yyvsp[-1].strval), SQLP_DATE, 0, 0 ); }
1392 #line 1393 "sqlp.tab.c"
1393  break;
1394 
1395  case 33: /* y_columndef: NAME TIME */
1396 #line 156 "sqlp.y"
1397  { sqpColumnDef( (yyvsp[-1].strval), SQLP_TIME, 0, 0 ); }
1398 #line 1399 "sqlp.tab.c"
1399  break;
1400 
1401  case 36: /* y_column_list: NAME */
1402 #line 165 "sqlp.y"
1403  { sqpColumn( (yyvsp[0].strval) ); }
1404 #line 1405 "sqlp.tab.c"
1405  break;
1406 
1407  case 37: /* y_column_list: y_column_list ',' NAME */
1408 #line 166 "sqlp.y"
1409  { sqpColumn( (yyvsp[0].strval) ); }
1410 #line 1411 "sqlp.tab.c"
1411  break;
1412 
1413  case 38: /* y_table: NAME */
1414 #line 170 "sqlp.y"
1415  { sqpTable( (yyvsp[0].strval) ); }
1416 #line 1417 "sqlp.tab.c"
1417  break;
1418 
1419  case 40: /* y_value_list: NULL_VALUE */
1420 #line 178 "sqlp.y"
1421  { sqpValue( NULL, 0, 0.0, SQLP_NULL ); }
1422 #line 1423 "sqlp.tab.c"
1423  break;
1424 
1425  case 41: /* y_value_list: STRING */
1426 #line 179 "sqlp.y"
1427  { sqpValue( (yyvsp[0].strval), 0, 0.0, SQLP_S ); }
1428 #line 1429 "sqlp.tab.c"
1429  break;
1430 
1431  case 42: /* y_value_list: INTNUM */
1432 #line 180 "sqlp.y"
1433  { sqpValue( NULL, (yyvsp[0].intval), 0.0, SQLP_I ); }
1434 #line 1435 "sqlp.tab.c"
1435  break;
1436 
1437  case 43: /* y_value_list: '-' INTNUM */
1438 #line 181 "sqlp.y"
1439  { sqpValue( NULL, -(yyvsp[0].intval), 0.0, SQLP_I ); }
1440 #line 1441 "sqlp.tab.c"
1441  break;
1442 
1443  case 44: /* y_value_list: FLOATNUM */
1444 #line 182 "sqlp.y"
1445  { sqpValue( NULL, 0, (yyvsp[0].floatval), SQLP_D ); }
1446 #line 1447 "sqlp.tab.c"
1447  break;
1448 
1449  case 45: /* y_value_list: '-' FLOATNUM */
1450 #line 183 "sqlp.y"
1451  { sqpValue( NULL, 0, -(yyvsp[0].floatval), SQLP_D ); }
1452 #line 1453 "sqlp.tab.c"
1453  break;
1454 
1455  case 46: /* y_value_list: y_value_list ',' NULL_VALUE */
1456 #line 184 "sqlp.y"
1457  { sqpValue( NULL, 0, 0.0, SQLP_NULL ); }
1458 #line 1459 "sqlp.tab.c"
1459  break;
1460 
1461  case 47: /* y_value_list: y_value_list ',' STRING */
1462 #line 185 "sqlp.y"
1463  { sqpValue( (yyvsp[0].strval), 0, 0.0, SQLP_S ); }
1464 #line 1465 "sqlp.tab.c"
1465  break;
1466 
1467  case 48: /* y_value_list: y_value_list ',' INTNUM */
1468 #line 186 "sqlp.y"
1469  { sqpValue( NULL, (yyvsp[0].intval), 0.0, SQLP_I ); }
1470 #line 1471 "sqlp.tab.c"
1471  break;
1472 
1473  case 49: /* y_value_list: y_value_list ',' '-' INTNUM */
1474 #line 187 "sqlp.y"
1475  { sqpValue( NULL, -(yyvsp[0].intval), 0.0, SQLP_I ); }
1476 #line 1477 "sqlp.tab.c"
1477  break;
1478 
1479  case 50: /* y_value_list: y_value_list ',' FLOATNUM */
1480 #line 188 "sqlp.y"
1481  { sqpValue( NULL, 0, (yyvsp[0].floatval), SQLP_D ); }
1482 #line 1483 "sqlp.tab.c"
1483  break;
1484 
1485  case 51: /* y_value_list: y_value_list ',' '-' FLOATNUM */
1486 #line 189 "sqlp.y"
1487  { sqpValue( NULL, 0, -(yyvsp[0].floatval), SQLP_D ); }
1488 #line 1489 "sqlp.tab.c"
1489  break;
1490 
1491  case 54: /* y_assignment: NAME EQUAL NULL_VALUE */
1492 #line 198 "sqlp.y"
1493  { sqpAssignment( (yyvsp[-2].strval), NULL, 0, 0.0, NULL, SQLP_NULL ); }
1494 #line 1495 "sqlp.tab.c"
1495  break;
1496 
1497  case 55: /* y_assignment: NAME EQUAL y_expression */
1498 #line 202 "sqlp.y"
1499  { sqpAssignment( (yyvsp[-2].strval), NULL, 0, 0.0, (yyvsp[0].node), SQLP_EXPR ); }
1500 #line 1501 "sqlp.tab.c"
1501  break;
1502 
1503  case 56: /* y_condition: y_sub_condition */
1504 #line 206 "sqlp.y"
1505  {
1506  (yyval.node) = (yyvsp[0].node);
1507  sqlpStmt->upperNodeptr = (yyval.node);
1508  }
1509 #line 1510 "sqlp.tab.c"
1510  break;
1511 
1512  case 57: /* y_sub_condition: y_sub_condition2 */
1513 #line 213 "sqlp.y"
1514  { (yyval.node) = (yyvsp[0].node); }
1515 #line 1516 "sqlp.tab.c"
1516  break;
1517 
1518  case 58: /* y_sub_condition: y_sub_condition OR y_sub_condition2 */
1519 #line 214 "sqlp.y"
1520  { (yyval.node) = sqpNewExpressionNode (SQLP_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
1521 #line 1522 "sqlp.tab.c"
1522  break;
1523 
1524  case 59: /* y_sub_condition2: y_boolean */
1525 #line 218 "sqlp.y"
1526  { (yyval.node) = (yyvsp[0].node); }
1527 #line 1528 "sqlp.tab.c"
1528  break;
1529 
1530  case 60: /* y_sub_condition2: y_sub_condition2 AND y_boolean */
1531 #line 219 "sqlp.y"
1532  { (yyval.node) = sqpNewExpressionNode (SQLP_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
1533 #line 1534 "sqlp.tab.c"
1534  break;
1535 
1536  case 61: /* y_boolean: y_comparison */
1537 #line 223 "sqlp.y"
1538  { (yyval.node) = (yyvsp[0].node); }
1539 #line 1540 "sqlp.tab.c"
1540  break;
1541 
1542  case 62: /* y_boolean: '(' y_sub_condition ')' */
1543 #line 224 "sqlp.y"
1544  { (yyval.node) = (yyvsp[-1].node); }
1545 #line 1546 "sqlp.tab.c"
1546  break;
1547 
1548  case 63: /* y_boolean: NOT y_boolean */
1549 #line 225 "sqlp.y"
1550  { (yyval.node) = sqpNewExpressionNode ( SQLP_NOT, NULL, (yyvsp[0].node)); }
1551 #line 1552 "sqlp.tab.c"
1552  break;
1553 
1554  case 64: /* y_comparison: y_expression EQUAL y_expression */
1555 #line 230 "sqlp.y"
1556  {
1557  (yyval.node) = sqpNewExpressionNode ( SQLP_EQ, (yyvsp[-2].node), (yyvsp[0].node));
1558  }
1559 #line 1560 "sqlp.tab.c"
1560  break;
1561 
1562  case 65: /* y_comparison: y_expression COMPARISON_OPERATOR y_expression */
1563 #line 233 "sqlp.y"
1564  {
1565  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode((yyvsp[-1].strval)), (yyvsp[-2].node), (yyvsp[0].node));
1566  }
1567 #line 1568 "sqlp.tab.c"
1568  break;
1569 
1570  case 66: /* y_comparison: y_expression IS NULL_VALUE */
1571 #line 236 "sqlp.y"
1572  {
1573  (yyval.node) = sqpNewExpressionNode ( SQLP_ISNULL, NULL, (yyvsp[-2].node));
1574  }
1575 #line 1576 "sqlp.tab.c"
1576  break;
1577 
1578  case 67: /* y_comparison: y_expression NOT NULL_VALUE */
1579 #line 239 "sqlp.y"
1580  {
1581  (yyval.node) = sqpNewExpressionNode ( SQLP_NOTNULL, NULL, (yyvsp[-2].node));
1582  }
1583 #line 1584 "sqlp.tab.c"
1584  break;
1585 
1586  case 68: /* y_expression: y_product */
1587 #line 246 "sqlp.y"
1588  { (yyval.node) = (yyvsp[0].node); }
1589 #line 1590 "sqlp.tab.c"
1590  break;
1591 
1592  case 69: /* y_expression: y_expression '+' y_product */
1593 #line 247 "sqlp.y"
1594  {
1595  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("+"), (yyvsp[-2].node), (yyvsp[0].node) );
1596  }
1597 #line 1598 "sqlp.tab.c"
1598  break;
1599 
1600  case 70: /* y_expression: y_expression '-' y_product */
1601 #line 250 "sqlp.y"
1602  {
1603  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), (yyvsp[-2].node), (yyvsp[0].node) );
1604  }
1605 #line 1606 "sqlp.tab.c"
1606  break;
1607 
1608  case 71: /* y_product: y_term */
1609 #line 256 "sqlp.y"
1610  { (yyval.node) = (yyvsp[0].node); }
1611 #line 1612 "sqlp.tab.c"
1612  break;
1613 
1614  case 72: /* y_product: y_product '*' y_term */
1615 #line 257 "sqlp.y"
1616  {
1617  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("*"), (yyvsp[-2].node), (yyvsp[0].node) );
1618  }
1619 #line 1620 "sqlp.tab.c"
1620  break;
1621 
1622  case 73: /* y_product: y_product '/' y_term */
1623 #line 260 "sqlp.y"
1624  {
1625  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("/"), (yyvsp[-2].node), (yyvsp[0].node) );
1626  }
1627 #line 1628 "sqlp.tab.c"
1628  break;
1629 
1630  case 74: /* y_term: y_atom */
1631 #line 266 "sqlp.y"
1632  { (yyval.node) = (yyvsp[0].node); }
1633 #line 1634 "sqlp.tab.c"
1634  break;
1635 
1636  case 75: /* y_term: '-' y_term */
1637 #line 267 "sqlp.y"
1638  {
1639  (yyval.node) = sqpNewExpressionNode ( sqpOperatorCode("-"), sqpNewValueNode ( NULL, 0, 0.0, SQLP_I ), (yyvsp[0].node) );
1640  }
1641 #line 1642 "sqlp.tab.c"
1642  break;
1643 
1644  case 76: /* y_atom: y_value */
1645 #line 273 "sqlp.y"
1646  { (yyval.node) = (yyvsp[0].node); }
1647 #line 1648 "sqlp.tab.c"
1648  break;
1649 
1650  case 77: /* y_atom: y_column */
1651 #line 274 "sqlp.y"
1652  { (yyval.node) = (yyvsp[0].node); }
1653 #line 1654 "sqlp.tab.c"
1654  break;
1655 
1656  case 78: /* y_atom: '(' y_expression ')' */
1657 #line 275 "sqlp.y"
1658  { (yyval.node) = (yyvsp[-1].node); }
1659 #line 1660 "sqlp.tab.c"
1660  break;
1661 
1662  case 79: /* y_value: STRING */
1663 #line 280 "sqlp.y"
1664  { (yyval.node) = sqpNewValueNode ( (yyvsp[0].strval), 0, 0.0, SQLP_S ); }
1665 #line 1666 "sqlp.tab.c"
1666  break;
1667 
1668  case 80: /* y_value: INTNUM */
1669 #line 281 "sqlp.y"
1670  { (yyval.node) = sqpNewValueNode ( NULL, (yyvsp[0].intval), 0.0, SQLP_I ); }
1671 #line 1672 "sqlp.tab.c"
1672  break;
1673 
1674  case 81: /* y_value: FLOATNUM */
1675 #line 282 "sqlp.y"
1676  { (yyval.node) = sqpNewValueNode ( NULL, 0, (yyvsp[0].floatval), SQLP_D ); }
1677 #line 1678 "sqlp.tab.c"
1678  break;
1679 
1680  case 82: /* y_column: NAME */
1681 #line 287 "sqlp.y"
1682  {(yyval.node) = sqpNewColumnNode ( (yyvsp[0].strval) );}
1683 #line 1684 "sqlp.tab.c"
1684  break;
1685 
1686  case 85: /* y_order_asc: NAME */
1687 #line 293 "sqlp.y"
1688  { sqpOrderColumn( (yyvsp[0].strval), SORT_ASC ); }
1689 #line 1690 "sqlp.tab.c"
1690  break;
1691 
1692  case 86: /* y_order_asc: NAME ASC */
1693 #line 294 "sqlp.y"
1694  { sqpOrderColumn( (yyvsp[-1].strval), SORT_ASC ); }
1695 #line 1696 "sqlp.tab.c"
1696  break;
1697 
1698  case 87: /* y_order_desc: NAME DESC */
1699 #line 297 "sqlp.y"
1700  { sqpOrderColumn( (yyvsp[-1].strval), SORT_DESC ); }
1701 #line 1702 "sqlp.tab.c"
1702  break;
1703 
1704 
1705 #line 1706 "sqlp.tab.c"
1706 
1707  default: break;
1708  }
1709  /* User semantic actions sometimes alter yychar, and that requires
1710  that yytoken be updated with the new translation. We take the
1711  approach of translating immediately before every use of yytoken.
1712  One alternative is translating here after every semantic action,
1713  but that translation would be missed if the semantic action invokes
1714  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1715  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1716  incorrect destructor might then be invoked immediately. In the
1717  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1718  to an incorrect destructor call or verbose syntax error message
1719  before the lookahead is translated. */
1720  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1721 
1722  YYPOPSTACK (yylen);
1723  yylen = 0;
1724 
1725  *++yyvsp = yyval;
1726 
1727  /* Now 'shift' the result of the reduction. Determine what state
1728  that goes to, based on the state we popped back to and the rule
1729  number reduced by. */
1730  {
1731  const int yylhs = yyr1[yyn] - YYNTOKENS;
1732  const int yyi = yypgoto[yylhs] + *yyssp;
1733  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1734  ? yytable[yyi]
1735  : yydefgoto[yylhs]);
1736  }
1737 
1738  goto yynewstate;
1739 
1740 
1741 /*--------------------------------------.
1742 | yyerrlab -- here on detecting error. |
1743 `--------------------------------------*/
1744 yyerrlab:
1745  /* Make sure we have latest lookahead translation. See comments at
1746  user semantic actions for why this is necessary. */
1747  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1748  /* If not already recovering from an error, report this error. */
1749  if (!yyerrstatus)
1750  {
1751  ++yynerrs;
1752  yyerror (YY_("syntax error"));
1753  }
1754 
1755  if (yyerrstatus == 3)
1756  {
1757  /* If just tried and failed to reuse lookahead token after an
1758  error, discard it. */
1759 
1760  if (yychar <= YYEOF)
1761  {
1762  /* Return failure if at end of input. */
1763  if (yychar == YYEOF)
1764  YYABORT;
1765  }
1766  else
1767  {
1768  yydestruct ("Error: discarding",
1769  yytoken, &yylval);
1770  yychar = YYEMPTY;
1771  }
1772  }
1773 
1774  /* Else will try to reuse lookahead token after shifting the error
1775  token. */
1776  goto yyerrlab1;
1777 
1778 
1779 /*---------------------------------------------------.
1780 | yyerrorlab -- error raised explicitly by YYERROR. |
1781 `---------------------------------------------------*/
1782 yyerrorlab:
1783  /* Pacify compilers when the user code never invokes YYERROR and the
1784  label yyerrorlab therefore never appears in user code. */
1785  if (0)
1786  YYERROR;
1787 
1788  /* Do not reclaim the symbols of the rule whose action triggered
1789  this YYERROR. */
1790  YYPOPSTACK (yylen);
1791  yylen = 0;
1792  YY_STACK_PRINT (yyss, yyssp);
1793  yystate = *yyssp;
1794  goto yyerrlab1;
1795 
1796 
1797 /*-------------------------------------------------------------.
1798 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1799 `-------------------------------------------------------------*/
1800 yyerrlab1:
1801  yyerrstatus = 3; /* Each real token shifted decrements this. */
1802 
1803  /* Pop stack until we find a state that shifts the error token. */
1804  for (;;)
1805  {
1806  yyn = yypact[yystate];
1807  if (!yypact_value_is_default (yyn))
1808  {
1809  yyn += YYSYMBOL_YYerror;
1810  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1811  {
1812  yyn = yytable[yyn];
1813  if (0 < yyn)
1814  break;
1815  }
1816  }
1817 
1818  /* Pop the current state because it cannot handle the error token. */
1819  if (yyssp == yyss)
1820  YYABORT;
1821 
1822 
1823  yydestruct ("Error: popping",
1824  YY_ACCESSING_SYMBOL (yystate), yyvsp);
1825  YYPOPSTACK (1);
1826  yystate = *yyssp;
1827  YY_STACK_PRINT (yyss, yyssp);
1828  }
1829 
1831  *++yyvsp = yylval;
1833 
1834 
1835  /* Shift the error token. */
1836  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1837 
1838  yystate = yyn;
1839  goto yynewstate;
1840 
1841 
1842 /*-------------------------------------.
1843 | yyacceptlab -- YYACCEPT comes here. |
1844 `-------------------------------------*/
1845 yyacceptlab:
1846  yyresult = 0;
1847  goto yyreturn;
1848 
1849 
1850 /*-----------------------------------.
1851 | yyabortlab -- YYABORT comes here. |
1852 `-----------------------------------*/
1853 yyabortlab:
1854  yyresult = 1;
1855  goto yyreturn;
1856 
1857 
1858 #if !defined yyoverflow
1859 /*-------------------------------------------------.
1860 | yyexhaustedlab -- memory exhaustion comes here. |
1861 `-------------------------------------------------*/
1862 yyexhaustedlab:
1863  yyerror (YY_("memory exhausted"));
1864  yyresult = 2;
1865  goto yyreturn;
1866 #endif
1867 
1868 
1869 /*-------------------------------------------------------.
1870 | yyreturn -- parsing is finished, clean up and return. |
1871 `-------------------------------------------------------*/
1872 yyreturn:
1873  if (yychar != YYEMPTY)
1874  {
1875  /* Make sure we have latest lookahead translation. See comments at
1876  user semantic actions for why this is necessary. */
1877  yytoken = YYTRANSLATE (yychar);
1878  yydestruct ("Cleanup: discarding lookahead",
1879  yytoken, &yylval);
1880  }
1881  /* Do not reclaim the symbols of the rule whose action triggered
1882  this YYABORT or YYACCEPT. */
1883  YYPOPSTACK (yylen);
1884  YY_STACK_PRINT (yyss, yyssp);
1885  while (yyssp != yyss)
1886  {
1887  yydestruct ("Cleanup: popping",
1888  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1889  YYPOPSTACK (1);
1890  }
1891 #ifndef yyoverflow
1892  if (yyss != yyssa)
1893  YYSTACK_FREE (yyss);
1894 #endif
1895 
1896  return yyresult;
1897 }
1898 
1899 #line 299 "sqlp.y"
1900 
#define NULL
Definition: ccmath.h:32
SQLPNODE * sqpNewValueNode(char *strval, int intval, double dblval, int type)
Definition: sql.c:242
void sqpValue(char *strval, int intval, double dblval, int type)
Definition: sql.c:128
SQLPNODE * sqpNewExpressionNode(int oper, SQLPNODE *left, SQLPNODE *right)
Definition: sql.c:216
int sqpOperatorCode(char *)
Definition: sql.c:279
void sqpColumn(char *column)
Definition: sql.c:101
void sqpCommand(int command)
Definition: sql.c:89
SQLPNODE * sqpNewColumnNode(char *name)
Definition: sql.c:230
void yyerror(const char *s)
void sqpColumnDef(char *column, int type, int width, int decimals)
Definition: sql.c:113
void sqpOrderColumn(char *col, int dir)
Definition: sql.c:199
void sqpTable(char *table)
Definition: sql.c:95
void sqpAssignment(char *column, char *strval, int intval, double dblval, SQLPNODE *expr, int type)
Definition: sql.c:161
#define SQLP_VARCHAR
Definition: sqlp.h:51
#define SQLP_DOUBLE
Definition: sqlp.h:53
#define SQLP_S
Definition: sqlp.h:44
#define SQLP_INSERT
Definition: sqlp.h:11
#define SQLP_D
Definition: sqlp.h:46
#define SQLP_TIME
Definition: sqlp.h:55
#define SQLP_ADD_COLUMN
Definition: sqlp.h:15
#define SQLP_ISNULL
Definition: sqlp.h:34
#define SQLP_DROP
Definition: sqlp.h:10
#define SORT_ASC
Definition: sqlp.h:66
#define SQLP_SELECT
Definition: sqlp.h:12
#define SQLP_CREATE
Definition: sqlp.h:9
#define SQLP_NOTNULL
Definition: sqlp.h:35
#define SQLP_EXPR
Definition: sqlp.h:48
#define SQLP_EQ
Definition: sqlp.h:26
#define SQLP_DATE
Definition: sqlp.h:54
#define SQLP_AND
Definition: sqlp.h:38
#define SQLP_DELETE
Definition: sqlp.h:14
#define SQLP_NOT
Definition: sqlp.h:40
#define SQLP_UPDATE
Definition: sqlp.h:13
#define SQLP_I
Definition: sqlp.h:45
#define SQLP_OR
Definition: sqlp.h:39
#define SORT_DESC
Definition: sqlp.h:67
#define SQLP_NULL
Definition: sqlp.h:43
#define SQLP_INTEGER
Definition: sqlp.h:52
#define SQLP_DROP_COLUMN
Definition: sqlp.h:16
SQLPSTMT * sqlpStmt
Definition: sql.c:37
@ YYENOMEM
Definition: sqlp.tab.c:806
int yynerrs
Definition: sqlp.tab.c:1020
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: sqlp.tab.c:366
#define YYMAXDEPTH
Definition: sqlp.tab.c:987
#define YYSTACK_FREE
Definition: sqlp.tab.c:428
yysymbol_kind_t
Definition: sqlp.tab.c:107
@ YYSYMBOL_46_
Definition: sqlp.tab.c:155
@ YYSYMBOL_NULL_VALUE
Definition: sqlp.tab.c:136
@ YYSYMBOL_41_
Definition: sqlp.tab.c:150
@ YYSYMBOL_STRING
Definition: sqlp.tab.c:114
@ YYSYMBOL_UPDATE
Definition: sqlp.tab.c:128
@ YYSYMBOL_YYUNDEF
Definition: sqlp.tab.c:111
@ YYSYMBOL_y_table
Definition: sqlp.tab.c:170
@ YYSYMBOL_y_comparison
Definition: sqlp.tab.c:179
@ YYSYMBOL_DOUBLE
Definition: sqlp.tab.c:140
@ YYSYMBOL_y_alter
Definition: sqlp.tab.c:159
@ YYSYMBOL_y_sub_condition2
Definition: sqlp.tab.c:177
@ YYSYMBOL_47_
Definition: sqlp.tab.c:156
@ YYSYMBOL_y_assignments
Definition: sqlp.tab.c:173
@ YYSYMBOL_INT
Definition: sqlp.tab.c:138
@ YYSYMBOL_INSERT
Definition: sqlp.tab.c:125
@ YYSYMBOL_FROM
Definition: sqlp.tab.c:122
@ YYSYMBOL_y_columns
Definition: sqlp.tab.c:168
@ YYSYMBOL_COMPARISON_OPERATOR
Definition: sqlp.tab.c:112
@ YYSYMBOL_y_column_list
Definition: sqlp.tab.c:169
@ YYSYMBOL_y_order_desc
Definition: sqlp.tab.c:188
@ YYSYMBOL_y_assignment
Definition: sqlp.tab.c:174
@ YYSYMBOL_y_condition
Definition: sqlp.tab.c:175
@ YYSYMBOL_TIME
Definition: sqlp.tab.c:143
@ YYSYMBOL_YYerror
Definition: sqlp.tab.c:110
@ YYSYMBOL_y_expression
Definition: sqlp.tab.c:180
@ YYSYMBOL_SET
Definition: sqlp.tab.c:129
@ YYSYMBOL_ASC
Definition: sqlp.tab.c:147
@ YYSYMBOL_PRECISION
Definition: sqlp.tab.c:141
@ YYSYMBOL_44_
Definition: sqlp.tab.c:153
@ YYSYMBOL_y_create
Definition: sqlp.tab.c:160
@ YYSYMBOL_DROP
Definition: sqlp.tab.c:118
@ YYSYMBOL_BY
Definition: sqlp.tab.c:145
@ YYSYMBOL_ADD
Definition: sqlp.tab.c:117
@ YYSYMBOL_COLUMN
Definition: sqlp.tab.c:119
@ YYSYMBOL_y_boolean
Definition: sqlp.tab.c:178
@ YYSYMBOL_AND
Definition: sqlp.tab.c:130
@ YYSYMBOL_WHERE
Definition: sqlp.tab.c:123
@ YYSYMBOL_TABLE
Definition: sqlp.tab.c:134
@ YYSYMBOL_y_atom
Definition: sqlp.tab.c:183
@ YYSYMBOL_42_
Definition: sqlp.tab.c:151
@ YYSYMBOL_y_order
Definition: sqlp.tab.c:186
@ YYSYMBOL_SELECT
Definition: sqlp.tab.c:121
@ YYSYMBOL_FLOATNUM
Definition: sqlp.tab.c:116
@ YYSYMBOL_INTO
Definition: sqlp.tab.c:126
@ YYSYMBOL_DESC
Definition: sqlp.tab.c:148
@ YYSYMBOL_y_select
Definition: sqlp.tab.c:162
@ YYSYMBOL_43_
Definition: sqlp.tab.c:152
@ YYSYMBOL_y_column
Definition: sqlp.tab.c:185
@ YYSYMBOL_CREATE
Definition: sqlp.tab.c:135
@ YYSYMBOL_y_product
Definition: sqlp.tab.c:181
@ YYSYMBOL_INTNUM
Definition: sqlp.tab.c:115
@ YYSYMBOL_y_value
Definition: sqlp.tab.c:184
@ YYSYMBOL_YYACCEPT
Definition: sqlp.tab.c:157
@ YYSYMBOL_OR
Definition: sqlp.tab.c:131
@ YYSYMBOL_y_insert
Definition: sqlp.tab.c:164
@ YYSYMBOL_YYEOF
Definition: sqlp.tab.c:109
@ YYSYMBOL_y_drop
Definition: sqlp.tab.c:161
@ YYSYMBOL_ORDER
Definition: sqlp.tab.c:144
@ YYSYMBOL_VARCHAR
Definition: sqlp.tab.c:137
@ YYSYMBOL_DATE
Definition: sqlp.tab.c:142
@ YYSYMBOL_VALUES
Definition: sqlp.tab.c:127
@ YYSYMBOL_y_columndefs
Definition: sqlp.tab.c:166
@ YYSYMBOL_y_value_list
Definition: sqlp.tab.c:172
@ YYSYMBOL_INTEGER
Definition: sqlp.tab.c:139
@ YYSYMBOL_y_order_asc
Definition: sqlp.tab.c:187
@ YYSYMBOL_y_delete
Definition: sqlp.tab.c:163
@ YYSYMBOL_y_sub_condition
Definition: sqlp.tab.c:176
@ YYSYMBOL_YYEMPTY
Definition: sqlp.tab.c:108
@ YYSYMBOL_EQUAL
Definition: sqlp.tab.c:120
@ YYSYMBOL_y_values
Definition: sqlp.tab.c:171
@ YYSYMBOL_IS
Definition: sqlp.tab.c:146
@ YYSYMBOL_DELETE
Definition: sqlp.tab.c:124
@ YYSYMBOL_y_update
Definition: sqlp.tab.c:165
@ YYSYMBOL_y_term
Definition: sqlp.tab.c:182
@ YYSYMBOL_ALTER
Definition: sqlp.tab.c:133
@ YYSYMBOL_NAME
Definition: sqlp.tab.c:113
@ YYSYMBOL_NOT
Definition: sqlp.tab.c:132
@ YYSYMBOL_y_sql
Definition: sqlp.tab.c:158
@ YYSYMBOL_45_
Definition: sqlp.tab.c:154
@ YYSYMBOL_y_columndef
Definition: sqlp.tab.c:167
@ YYSYMBOL_40_
Definition: sqlp.tab.c:149
#define YY_ASSERT(E)
Definition: sqlp.tab.c:386
#define YY_(Msgid)
Definition: sqlp.tab.c:326
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: sqlp.tab.c:367
#define YYNSTATES
Definition: sqlp.tab.c:527
#define YY_IGNORE_USELESS_CAST_END
Definition: sqlp.tab.c:382
short yytype_int16
Definition: sqlp.tab.c:237
#define YYABORT
Definition: sqlp.tab.c:812
#define YYSTACK_BYTES(N)
Definition: sqlp.tab.c:471
yytype_uint8 yy_state_t
Definition: sqlp.tab.c:313
#define YY_REDUCE_PRINT(Rule)
Definition: sqlp.tab.c:957
#define YY_CAST(Type, Val)
Definition: sqlp.tab.c:88
YYSTYPE yylval
Definition: sqlp.tab.c:1018
#define YY_NULLPTR
Definition: sqlp.tab.c:100
void * malloc(YYSIZE_T)
#define YYFINAL
Definition: sqlp.tab.c:516
#define YY_ACCESSING_SYMBOL(State)
Definition: sqlp.tab.c:593
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: sqlp.tab.c:860
#define YYNTOKENS
Definition: sqlp.tab.c:521
unsigned char yytype_uint8
Definition: sqlp.tab.c:258
#define YY_STACK_PRINT(Bottom, Top)
Definition: sqlp.tab.c:926
#define YYSIZE_T
Definition: sqlp.tab.c:299
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: sqlp.tab.c:381
int yyparse(void)
Definition: sqlp.tab.c:1030
#define YYPTRDIFF_T
Definition: sqlp.tab.c:285
int yylex(void)
int yychar
Definition: sqlp.tab.c:1015
#define YYACCEPT
Definition: sqlp.tab.c:811
#define yytable_value_is_error(Yyn)
Definition: sqlp.tab.c:646
#define YYTRANSLATE(YYX)
Definition: sqlp.tab.c:535
int yydebug
Definition: sqlp.tab.c:965
#define YY_ATTRIBUTE_UNUSED
Definition: sqlp.tab.c:343
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition: sqlp.tab.c:316
unsigned short yytype_uint16
Definition: sqlp.tab.c:269
#define YYLAST
Definition: sqlp.tab.c:518
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: sqlp.tab.c:482
#define yypact_value_is_default(Yyn)
Definition: sqlp.tab.c:641
#define YYINITDEPTH
Definition: sqlp.tab.c:976
signed char yytype_int8
Definition: sqlp.tab.c:229
void free(void *)
#define YYERROR
Definition: sqlp.tab.c:813
#define YYSIZEOF(X)
Definition: sqlp.tab.c:309
#define YYFPRINTF
Definition: sqlp.tab.c:845
#define YYSTACK_ALLOC
Definition: sqlp.tab.c:427
#define YYDPRINTF(Args)
Definition: sqlp.tab.c:848
#define YY_USE(E)
Definition: sqlp.tab.c:349
@ YYEOF
Definition: sqlp.tab.h:54
@ YYerror
Definition: sqlp.tab.h:55
@ YYEMPTY
Definition: sqlp.tab.h:53
@ YYUNDEF
Definition: sqlp.tab.h:56
void * yyalloc(yy_size_t)
SQLPNODE * upperNodeptr
Definition: sqlp.h:102
SQLPNODE * node
Definition: sqlp.tab.h:150