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