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