1
/* A Bison parser, made by GNU Bison 2.5. */
3
/* Bison implementation for Yacc-like parsers in C
5
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7
This program is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
/* As a special exception, you may create a larger work that contains
21
part or all of the Bison parser skeleton and distribute that work
22
under terms of your choice, so long as that work isn't itself a
23
parser generator using the skeleton or a modified version thereof
24
as a parser skeleton. Alternatively, if you modify or redistribute
25
the parser skeleton itself, you may (at your option) remove this
26
special exception, which will cause the skeleton and the resulting
27
Bison output files to be licensed under the GNU General Public
28
License without this special exception.
30
This special exception was added by the Free Software Foundation in
31
version 2.2 of Bison. */
33
/* C LALR(1) parser skeleton written by Richard Stallman, by
34
simplifying the original so-called "semantic" parser. */
36
/* All symbols defined below should begin with yy or YY, to avoid
37
infringing on user name space. This should be done even for local
38
variables, as they might otherwise be expanded by user macros.
39
There are some unavoidable exceptions within include files to
40
define necessary library symbols; they are noted "INFRINGES ON
41
USER NAME SPACE" below. */
43
/* Identify Bison output. */
47
#define YYBISON_VERSION "2.5"
50
#define YYSKELETON_NAME "yacc.c"
61
/* Using locations. */
62
#define YYLSP_NEEDED 0
66
/* Copy the first part of user declarations. */
68
/* Line 268 of yacc.c */
69
#line 438 "sqlparser.y"
71
#ifndef YYDEBUG /* compat. */
82
//workaround for bug on msvc
86
# define LLONG_MAX 0x7fffffffffffffffLL
89
# define LLONG_MIN 0x8000000000000000LL
92
# define ULLONG_MAX 0xffffffffffffffffLL
106
#include <db/connection.h>
107
#include <db/queryschema.h>
108
#include <db/field.h>
109
#include <db/tableschema.h>
112
#include "parser_p.h"
113
#include "sqltypes.h"
120
// using namespace std;
121
using namespace KexiDB;
124
#define YYSTACK_USE_ALLOCA 1
125
#define YYMAXDEPTH 255
138
QString parserUserName;
140
KexiDBField::ColumnType coltype;
146
/* Line 268 of yacc.c */
147
#line 148 "sqlparser.cpp"
149
/* Enabling traces. */
154
/* Enabling verbose error messages. */
155
#ifdef YYERROR_VERBOSE
156
# undef YYERROR_VERBOSE
157
# define YYERROR_VERBOSE 1
159
# define YYERROR_VERBOSE 0
162
/* Enabling the token table. */
163
#ifndef YYTOKEN_TABLE
164
# define YYTOKEN_TABLE 0
171
/* Put the tokens into the symbol table, so that GDB and other debuggers
202
AUTO_INCREMENT = 286,
211
BITWISE_SHIFT_LEFT = 295,
212
BITWISE_SHIFT_RIGHT = 296,
224
CHARACTER_STRING_LITERAL = 308,
251
CURRENT_TIMESTAMP = 335,
257
DATE_REMAINDER = 341,
282
DOUBLE_QUOTED_STRING = 366,
316
GREATER_OR_EQUAL = 400,
364
MINUTES_BETWEEN = 448,
369
MONTHS_BETWEEN = 453,
384
SQL_IS_NOT_NULL = 468,
435
SECONDS_BETWEEN = 519,
443
NOT_SIMILAR_TO = 527,
447
DATETIME_CONST = 531,
466
SYSDATE_FORMAT = 550,
476
TIMEZONE_MINUTE = 560,
496
IDENTIFIER_DOT_ASTERISK = 580,
497
QUERY_PARAMETER = 581,
510
WHERE_CURRENT_OF = 594,
526
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
527
typedef union YYSTYPE
530
/* Line 293 of yacc.c */
531
#line 514 "sqlparser.y"
533
QString* stringValue;
536
struct realType realValue;
537
KexiDB::Field::Type colType;
538
KexiDB::Field *field;
539
KexiDB::BaseExpr *expr;
540
KexiDB::NArgExpr *exprList;
541
KexiDB::ConstExpr *constExpr;
542
KexiDB::QuerySchema *querySchema;
543
SelectOptionsInternal *selectOptions;
544
OrderByColumnInternal::List *orderByColumns;
545
QVariant *variantValue;
549
/* Line 293 of yacc.c */
550
#line 551 "sqlparser.cpp"
552
# define YYSTYPE_IS_TRIVIAL 1
553
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
554
# define YYSTYPE_IS_DECLARED 1
558
/* Copy the second part of user declarations. */
561
/* Line 343 of yacc.c */
562
#line 563 "sqlparser.cpp"
569
typedef YYTYPE_UINT8 yytype_uint8;
571
typedef unsigned char yytype_uint8;
575
typedef YYTYPE_INT8 yytype_int8;
576
#elif (defined __STDC__ || defined __C99__FUNC__ \
577
|| defined __cplusplus || defined _MSC_VER)
578
typedef signed char yytype_int8;
580
typedef short int yytype_int8;
584
typedef YYTYPE_UINT16 yytype_uint16;
586
typedef unsigned short int yytype_uint16;
590
typedef YYTYPE_INT16 yytype_int16;
592
typedef short int yytype_int16;
596
# ifdef __SIZE_TYPE__
597
# define YYSIZE_T __SIZE_TYPE__
598
# elif defined size_t
599
# define YYSIZE_T size_t
600
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
601
|| defined __cplusplus || defined _MSC_VER)
602
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
603
# define YYSIZE_T size_t
605
# define YYSIZE_T unsigned int
609
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
612
# if defined YYENABLE_NLS && YYENABLE_NLS
614
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
615
# define YY_(msgid) dgettext ("bison-runtime", msgid)
619
# define YY_(msgid) msgid
623
/* Suppress unused-variable warnings by "using" E. */
624
#if ! defined lint || defined __GNUC__
625
# define YYUSE(e) ((void) (e))
627
# define YYUSE(e) /* empty */
630
/* Identity function, used to suppress warnings about constant conditions. */
634
#if (defined __STDC__ || defined __C99__FUNC__ \
635
|| defined __cplusplus || defined _MSC_VER)
648
#if ! defined yyoverflow || YYERROR_VERBOSE
650
/* The parser invokes alloca or malloc; define the necessary symbols. */
652
# ifdef YYSTACK_USE_ALLOCA
653
# if YYSTACK_USE_ALLOCA
655
# define YYSTACK_ALLOC __builtin_alloca
656
# elif defined __BUILTIN_VA_ARG_INCR
657
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
659
# define YYSTACK_ALLOC __alloca
660
# elif defined _MSC_VER
661
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
662
# define alloca _alloca
664
# define YYSTACK_ALLOC alloca
665
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
666
|| defined __cplusplus || defined _MSC_VER)
667
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
668
# ifndef EXIT_SUCCESS
669
# define EXIT_SUCCESS 0
676
# ifdef YYSTACK_ALLOC
677
/* Pacify GCC's `empty if-body' warning. */
678
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
679
# ifndef YYSTACK_ALLOC_MAXIMUM
680
/* The OS might guarantee only one guard page at the bottom of the stack,
681
and a page size can be as small as 4096 bytes. So we cannot safely
682
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
683
to allow for a few compiler-allocated temporary stack slots. */
684
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
687
# define YYSTACK_ALLOC YYMALLOC
688
# define YYSTACK_FREE YYFREE
689
# ifndef YYSTACK_ALLOC_MAXIMUM
690
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
692
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
693
&& ! ((defined YYMALLOC || defined malloc) \
694
&& (defined YYFREE || defined free)))
695
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
696
# ifndef EXIT_SUCCESS
697
# define EXIT_SUCCESS 0
701
# define YYMALLOC malloc
702
# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
703
|| defined __cplusplus || defined _MSC_VER)
704
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
709
# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
710
|| defined __cplusplus || defined _MSC_VER)
711
void free (void *); /* INFRINGES ON USER NAME SPACE */
715
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
718
#if (! defined yyoverflow \
719
&& (! defined __cplusplus \
720
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
722
/* A type that is properly aligned for any stack member. */
725
yytype_int16 yyss_alloc;
729
/* The size of the maximum gap between one aligned stack and the next. */
730
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
732
/* The size of an array large to enough to hold all stacks, each with
734
# define YYSTACK_BYTES(N) \
735
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
736
+ YYSTACK_GAP_MAXIMUM)
738
# define YYCOPY_NEEDED 1
740
/* Relocate STACK from its old location to the new one. The
741
local variables YYSIZE and YYSTACKSIZE give the old and new number of
742
elements in the stack, and YYPTR gives the new location of the
743
stack. Advance YYPTR to a properly aligned location for the next
745
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
748
YYSIZE_T yynewbytes; \
749
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
750
Stack = &yyptr->Stack_alloc; \
751
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
752
yyptr += yynewbytes / sizeof (*yyptr); \
758
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
759
/* Copy COUNT objects from FROM to TO. The source and destination do
762
# if defined __GNUC__ && 1 < __GNUC__
763
# define YYCOPY(To, From, Count) \
764
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
766
# define YYCOPY(To, From, Count) \
770
for (yyi = 0; yyi < (Count); yyi++) \
771
(To)[yyi] = (From)[yyi]; \
776
#endif /* !YYCOPY_NEEDED */
778
/* YYFINAL -- State number of the termination state. */
780
/* YYLAST -- Last index in YYTABLE. */
783
/* YYNTOKENS -- Number of terminals. */
784
#define YYNTOKENS 373
785
/* YYNNTS -- Number of nonterminals. */
787
/* YYNRULES -- Number of rules. */
789
/* YYNRULES -- Number of states. */
790
#define YYNSTATES 178
792
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
794
#define YYMAXUTOK 604
796
#define YYTRANSLATE(YYX) \
797
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
799
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
800
static const yytype_uint16 yytranslate[] =
802
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
803
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
804
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
805
2, 2, 2, 2, 2, 2, 357, 352, 370, 361,
806
358, 359, 351, 350, 355, 349, 356, 362, 2, 2,
807
2, 2, 2, 2, 2, 2, 2, 2, 2, 354,
808
364, 363, 365, 360, 353, 2, 2, 2, 2, 2,
809
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
810
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
811
2, 368, 2, 369, 367, 2, 2, 2, 2, 2,
812
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
813
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
814
2, 2, 2, 2, 371, 2, 372, 2, 2, 2,
815
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
816
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
817
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
818
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
819
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
820
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
821
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
822
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
823
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
824
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
825
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
826
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
827
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
828
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
829
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
830
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
831
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
832
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
833
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
834
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
835
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
836
85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
837
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
838
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
839
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
840
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
841
135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
842
145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
843
155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
844
165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
845
175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
846
185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
847
195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
848
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
849
215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
850
225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
851
235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
852
245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
853
255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
854
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
855
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
856
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
857
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
858
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
859
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
860
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
861
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
862
345, 346, 347, 348, 366
866
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
868
static const yytype_uint16 yyprhs[] =
870
0, 0, 3, 5, 9, 11, 14, 16, 18, 19,
871
27, 31, 33, 36, 40, 43, 45, 48, 51, 53,
872
55, 60, 65, 66, 69, 73, 76, 80, 85, 87,
873
89, 93, 98, 103, 106, 108, 111, 115, 120, 122,
874
126, 128, 130, 132, 134, 138, 142, 146, 148, 152,
875
156, 160, 164, 168, 170, 174, 178, 182, 186, 190,
876
194, 196, 199, 202, 204, 208, 212, 214, 218, 222,
877
226, 230, 234, 236, 240, 244, 248, 250, 253, 256,
878
259, 262, 264, 266, 269, 273, 275, 277, 279, 281,
879
283, 287, 291, 295, 299, 302, 306, 308, 310, 313,
880
317, 321, 323, 325, 327, 331, 334, 336, 341, 343
883
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
884
static const yytype_int16 yyrhs[] =
886
374, 0, -1, 375, -1, 376, 354, 375, -1, 376,
887
-1, 376, 354, -1, 377, -1, 384, -1, -1, 75,
888
297, 324, 378, 358, 379, 359, -1, 379, 355, 380,
889
-1, 380, -1, 324, 383, -1, 324, 383, 381, -1,
890
381, 382, -1, 382, -1, 239, 170, -1, 206, 210,
891
-1, 31, -1, 4, -1, 4, 358, 273, 359, -1,
892
331, 358, 273, 359, -1, -1, 385, 406, -1, 385,
893
406, 403, -1, 385, 403, -1, 385, 406, 386, -1,
894
385, 406, 403, 386, -1, 265, -1, 387, -1, 225,
895
43, 388, -1, 387, 225, 43, 388, -1, 225, 43,
896
388, 387, -1, 338, 391, -1, 389, -1, 389, 390,
897
-1, 389, 355, 388, -1, 389, 390, 355, 388, -1,
898
324, -1, 324, 356, 324, -1, 273, -1, 25, -1,
899
100, -1, 392, -1, 393, 20, 392, -1, 393, 224,
900
392, -1, 393, 344, 392, -1, 393, -1, 394, 365,
901
393, -1, 394, 145, 393, -1, 394, 364, 393, -1,
902
394, 176, 393, -1, 394, 363, 393, -1, 394, -1,
903
395, 207, 394, -1, 395, 208, 394, -1, 395, 178,
904
394, -1, 395, 153, 394, -1, 395, 271, 394, -1,
905
395, 272, 394, -1, 395, -1, 395, 212, -1, 395,
906
213, -1, 396, -1, 397, 40, 396, -1, 397, 41,
907
396, -1, 397, -1, 398, 350, 397, -1, 398, 64,
908
397, -1, 398, 349, 397, -1, 398, 370, 397, -1,
909
398, 371, 397, -1, 398, -1, 399, 362, 398, -1,
910
399, 351, 398, -1, 399, 352, 398, -1, 399, -1,
911
349, 399, -1, 350, 399, -1, 372, 399, -1, 206,
912
399, -1, 324, -1, 326, -1, 324, 401, -1, 324,
913
356, 324, -1, 210, -1, 53, -1, 273, -1, 274,
914
-1, 400, -1, 358, 391, 359, -1, 358, 402, 359,
915
-1, 391, 355, 402, -1, 391, 355, 391, -1, 138,
916
404, -1, 404, 355, 405, -1, 405, -1, 324, -1,
917
324, 324, -1, 324, 23, 324, -1, 406, 355, 407,
918
-1, 407, -1, 408, -1, 409, -1, 408, 23, 324,
919
-1, 408, 324, -1, 391, -1, 108, 358, 408, 359,
920
-1, 351, -1, 324, 356, 351, -1
923
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
924
static const yytype_uint16 yyrline[] =
926
0, 583, 583, 593, 597, 598, 608, 612, 620, 619,
927
629, 629, 635, 643, 659, 659, 665, 670, 675, 683,
928
688, 695, 702, 710, 717, 722, 728, 734, 743, 753,
929
759, 765, 772, 782, 791, 800, 810, 818, 830, 836,
930
843, 850, 854, 861, 866, 871, 875, 880, 885, 889,
931
893, 897, 901, 906, 911, 916, 920, 924, 928, 932,
932
937, 942, 946, 951, 956, 960, 965, 970, 975, 979,
933
983, 987, 992, 997, 1001, 1005, 1010, 1016, 1020, 1024,
934
1028, 1032, 1040, 1046, 1053, 1060, 1067, 1073, 1090, 1096,
935
1101, 1109, 1119, 1124, 1133, 1178, 1183, 1191, 1219, 1230,
936
1246, 1252, 1261, 1270, 1275, 1284, 1296, 1340, 1349, 1358
940
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
941
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
942
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
943
static const char *const yytname[] =
945
"$end", "error", "$undefined", "UMINUS", "SQL_TYPE", "SQL_ABS", "ACOS",
946
"AMPERSAND", "SQL_ABSOLUTE", "ADA", "ADD", "ADD_DAYS", "ADD_HOURS",
947
"ADD_MINUTES", "ADD_MONTHS", "ADD_SECONDS", "ADD_YEARS", "ALL",
948
"ALLOCATE", "ALTER", "AND", "ANY", "ARE", "AS", "ASIN", "ASC", "ASCII",
949
"ASSERTION", "ATAN", "ATAN2", "AUTHORIZATION", "AUTO_INCREMENT", "AVG",
950
"BEFORE", "SQL_BEGIN", "BETWEEN", "BIGINT", "BINARY", "BIT",
951
"BIT_LENGTH", "BITWISE_SHIFT_LEFT", "BITWISE_SHIFT_RIGHT", "BREAK", "BY",
952
"CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CEILING", "CENTER",
953
"SQL_CHAR", "CHAR_LENGTH", "CHARACTER_STRING_LITERAL", "CHECK", "CLOSE",
954
"COALESCE", "COBOL", "COLLATE", "COLLATION", "COLUMN", "COMMIT",
955
"COMPUTE", "CONCAT", "CONCATENATION", "CONNECT", "CONNECTION",
956
"CONSTRAINT", "CONSTRAINTS", "CONTINUE", "CONVERT", "CORRESPONDING",
957
"COS", "COT", "COUNT", "CREATE", "CURDATE", "CURRENT", "CURRENT_DATE",
958
"CURRENT_TIME", "CURRENT_TIMESTAMP", "CURTIME", "CURSOR", "DATABASE",
959
"SQL_DATE", "DATE_FORMAT", "DATE_REMAINDER", "DATE_VALUE", "DAY",
960
"DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DAYS_BETWEEN", "DEALLOCATE",
961
"DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
962
"DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
963
"DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
964
"SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
965
"EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
966
"EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
967
"FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
968
"FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
969
"GRANT", "GREATER_OR_EQUAL", "HAVING", "HOUR", "HOURS_BETWEEN",
970
"IDENTITY", "IFNULL", "SQL_IGNORE", "IMMEDIATE", "SQL_IN", "INCLUDE",
971
"INDEX", "INDICATOR", "INITIALLY", "INNER", "SQL_INPUT", "INSENSITIVE",
972
"INSERT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", "IS", "ISOLATION",
973
"JOIN", "JUSTIFY", "KEY", "LANGUAGE", "LAST", "LCASE", "LEFT", "LENGTH",
974
"LESS_OR_EQUAL", "LEVEL", "LIKE", "LINE_WIDTH", "LOCAL", "LOCATE", "LOG",
975
"SQL_LONG", "LOWER", "LTRIM", "LTRIP", "MATCH", "SQL_MAX", "MICROSOFT",
976
"SQL_MIN", "MINUS", "MINUTE", "MINUTES_BETWEEN", "MOD", "MODIFY",
977
"MODULE", "MONTH", "MONTHS_BETWEEN", "MUMPS", "NAMES", "NATIONAL",
978
"NCHAR", "NEXT", "NODUP", "NONE", "NOT", "NOT_EQUAL", "NOT_EQUAL2",
979
"NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
980
"NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
981
"OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
982
"PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
983
"PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
984
"PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
985
"REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
986
"ROLLBACK", "ROWS", "RPAD", "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL",
987
"SECOND", "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET",
988
"SHOWOPT", "SIGN", "SIMILAR_TO", "NOT_SIMILAR_TO", "INTEGER_CONST",
989
"REAL_CONST", "DATE_CONST", "DATETIME_CONST", "TIME_CONST", "SIN",
990
"SQL_SIZE", "SMALLINT", "SOME", "SPACE", "SQL", "SQL_TRUE", "SQLCA",
991
"SQLCODE", "SQLERROR", "SQLSTATE", "SQLWARNING", "SQRT", "STDEV",
992
"SUBSTRING", "SUM", "SYSDATE", "SYSDATE_FORMAT", "SYSTEM", "TABLE",
993
"TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
994
"TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
995
"TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
996
"GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
997
"UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
998
"IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
999
"VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
1000
"WHENEVER", "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", "WORK",
1001
"WRAPPED", "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", "__LAST_TOKEN",
1002
"'-'", "'+'", "'*'", "'%'", "'@'", "';'", "','", "'.'", "'$'", "'('",
1003
"')'", "'?'", "'\\''", "'/'", "'='", "'<'", "'>'", "ILIKE", "'^'", "'['",
1004
"']'", "'&'", "'|'", "'~'", "$accept", "TopLevelStatement",
1005
"StatementList", "Statement", "CreateTableStatement", "$@1", "ColDefs",
1006
"ColDef", "ColKeys", "ColKey", "ColType", "SelectStatement", "Select",
1007
"SelectOptions", "WhereClause", "OrderByClause", "OrderByColumnId",
1008
"OrderByOption", "aExpr", "aExpr2", "aExpr3", "aExpr4", "aExpr5",
1009
"aExpr6", "aExpr7", "aExpr8", "aExpr9", "aExpr10", "aExprList",
1010
"aExprList2", "Tables", "FlatTableList", "FlatTable", "ColViews",
1011
"ColItem", "ColExpression", "ColWildCard", 0
1016
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1018
static const yytype_uint16 yytoknum[] =
1020
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1021
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1022
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1023
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1024
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1025
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1026
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1027
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1028
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1029
345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1030
355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1031
365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1032
375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1033
385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1034
395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1035
405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
1036
415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
1037
425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
1038
435, 436, 437, 438, 439, 440, 441, 442, 443, 444,
1039
445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
1040
455, 456, 457, 458, 459, 460, 461, 462, 463, 464,
1041
465, 466, 467, 468, 469, 470, 471, 472, 473, 474,
1042
475, 476, 477, 478, 479, 480, 481, 482, 483, 484,
1043
485, 486, 487, 488, 489, 490, 491, 492, 493, 494,
1044
495, 496, 497, 498, 499, 500, 501, 502, 503, 504,
1045
505, 506, 507, 508, 509, 510, 511, 512, 513, 514,
1046
515, 516, 517, 518, 519, 520, 521, 522, 523, 524,
1047
525, 526, 527, 528, 529, 530, 531, 532, 533, 534,
1048
535, 536, 537, 538, 539, 540, 541, 542, 543, 544,
1049
545, 546, 547, 548, 549, 550, 551, 552, 553, 554,
1050
555, 556, 557, 558, 559, 560, 561, 562, 563, 564,
1051
565, 566, 567, 568, 569, 570, 571, 572, 573, 574,
1052
575, 576, 577, 578, 579, 580, 581, 582, 583, 584,
1053
585, 586, 587, 588, 589, 590, 591, 592, 593, 594,
1054
595, 596, 597, 598, 599, 600, 601, 602, 603, 45,
1055
43, 42, 37, 64, 59, 44, 46, 36, 40, 41,
1056
63, 39, 47, 61, 60, 62, 604, 94, 91, 93,
1061
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1062
static const yytype_uint16 yyr1[] =
1064
0, 373, 374, 375, 375, 375, 376, 376, 378, 377,
1065
379, 379, 380, 380, 381, 381, 382, 382, 382, 383,
1066
383, 383, 383, 384, 384, 384, 384, 384, 385, 386,
1067
386, 386, 386, 387, 388, 388, 388, 388, 389, 389,
1068
389, 390, 390, 391, 392, 392, 392, 392, 393, 393,
1069
393, 393, 393, 393, 394, 394, 394, 394, 394, 394,
1070
394, 395, 395, 395, 396, 396, 396, 397, 397, 397,
1071
397, 397, 397, 398, 398, 398, 398, 399, 399, 399,
1072
399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
1073
400, 401, 402, 402, 403, 404, 404, 405, 405, 405,
1074
406, 406, 407, 407, 407, 407, 408, 408, 409, 409
1077
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1078
static const yytype_uint8 yyr2[] =
1080
0, 2, 1, 3, 1, 2, 1, 1, 0, 7,
1081
3, 1, 2, 3, 2, 1, 2, 2, 1, 1,
1082
4, 4, 0, 2, 3, 2, 3, 4, 1, 1,
1083
3, 4, 4, 2, 1, 2, 3, 4, 1, 3,
1084
1, 1, 1, 1, 3, 3, 3, 1, 3, 3,
1085
3, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1086
1, 2, 2, 1, 3, 3, 1, 3, 3, 3,
1087
3, 3, 1, 3, 3, 3, 1, 2, 2, 2,
1088
2, 1, 1, 2, 3, 1, 1, 1, 1, 1,
1089
3, 3, 3, 3, 2, 3, 1, 1, 2, 3,
1090
3, 1, 1, 1, 3, 2, 1, 4, 1, 3
1093
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
1094
Performed when YYTABLE doesn't specify something else to do. Zero
1095
means the default is an error. */
1096
static const yytype_uint8 yydefact[] =
1098
0, 0, 28, 0, 2, 4, 6, 7, 0, 0,
1099
1, 5, 86, 0, 0, 0, 85, 87, 88, 81,
1100
82, 0, 0, 108, 0, 0, 106, 43, 47, 53,
1101
60, 63, 66, 72, 76, 89, 25, 23, 101, 102,
1102
103, 8, 3, 0, 97, 94, 96, 81, 80, 0,
1103
0, 83, 77, 78, 0, 79, 0, 0, 0, 0,
1104
0, 0, 0, 0, 0, 0, 0, 0, 61, 62,
1105
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1106
0, 0, 0, 0, 0, 26, 29, 24, 0, 105,
1107
0, 0, 0, 98, 0, 0, 84, 109, 0, 0,
1108
90, 44, 45, 46, 49, 51, 52, 50, 48, 57,
1109
56, 54, 55, 58, 59, 64, 65, 68, 69, 67,
1110
70, 71, 74, 75, 73, 0, 33, 100, 0, 27,
1111
104, 0, 107, 99, 95, 0, 91, 40, 38, 30,
1112
34, 0, 22, 0, 11, 93, 92, 0, 32, 41,
1113
42, 0, 35, 31, 19, 0, 12, 0, 9, 39,
1114
36, 0, 0, 0, 18, 0, 0, 13, 15, 10,
1115
37, 0, 0, 17, 16, 14, 20, 21
1118
/* YYDEFGOTO[NTERM-NUM]. */
1119
static const yytype_int16 yydefgoto[] =
1121
-1, 3, 4, 5, 6, 90, 143, 144, 167, 168,
1122
156, 7, 8, 85, 86, 139, 140, 152, 26, 27,
1123
28, 29, 30, 31, 32, 33, 34, 35, 51, 99,
1124
36, 45, 46, 37, 38, 39, 40
1127
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1129
#define YYPACT_NINF -333
1130
static const yytype_int16 yypact[] =
1132
-66, -267, -333, 51, -333, -302, -333, -333, -50, -265,
1133
-333, -66, -333, -298, -262, -37, -333, -333, -333, -323,
1134
-333, -37, -37, -333, -37, -37, -333, -333, -18, -135,
1135
-142, -333, -15, -56, -331, -333, -333, -133, -333, -19,
1136
-333, -333, -333, -40, -8, -292, -333, -316, -333, -305,
1137
-37, -333, -333, -333, -295, -333, -37, -37, -37, -37,
1138
-37, -37, -37, -37, -37, -37, -37, -37, -333, -333,
1139
-37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
1140
-37, -37, 24, -37, -47, -333, -153, -213, -251, -333,
1141
-284, -272, -235, -333, -262, -234, -333, -333, -264, -266,
1142
-333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1143
-333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1144
-333, -333, -333, -333, -333, -255, -333, -333, 52, -333,
1145
-333, -230, -333, -333, -333, -37, -333, -333, -260, -241,
1146
-25, -255, -3, -332, -333, -264, -333, -226, -333, -333,
1147
-333, -255, -256, -333, -258, -257, -24, -230, -333, -333,
1148
-333, -255, -171, -170, -333, -106, -65, -24, -333, -333,
1149
-333, -253, -252, -333, -333, -333, -333, -333
1152
/* YYPGOTO[NTERM-NUM]. */
1153
static const yytype_int16 yypgoto[] =
1155
-333, -333, 97, -333, -333, -333, -333, -48, -333, -57,
1156
-333, -333, -333, 25, -26, -127, -333, -333, -7, -1,
1157
18, -17, -333, -28, 8, -42, 7, -333, -333, -21,
1158
74, -333, 21, -333, 32, 75, -333
1161
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1162
positive, shift that token. If negative, reduce the rule which
1163
number is the opposite. If YYTABLE_NINF, syntax error. */
1164
#define YYTABLE_NINF -1
1165
static const yytype_uint8 yytable[] =
1167
149, 154, 56, 12, 88, 14, 12, 164, 74, 1,
1168
59, 64, 82, 12, 153, 92, 12, 54, 137, 96,
1169
79, 80, 48, 157, 160, 72, 73, 158, 52, 53,
1170
9, 81, 55, 49, 170, 50, 65, 122, 123, 124,
1171
95, 60, 50, 98, 115, 116, 97, 109, 110, 111,
1172
112, 10, 11, 113, 114, 101, 102, 103, 13, 41,
1173
43, 13, 44, 94, 100, 66, 67, 125, 13, 138,
1174
68, 69, 128, 130, 131, 150, 126, 104, 105, 106,
1175
107, 108, 117, 118, 119, 120, 121, 132, 14, 133,
1176
96, 135, 82, 136, 142, 141, 147, 83, 159, 161,
1177
162, 163, 171, 172, 173, 174, 176, 177, 42, 169,
1178
175, 87, 129, 148, 146, 134, 127, 0, 91, 0,
1179
0, 0, 0, 0, 0, 83, 0, 0, 145, 70,
1180
71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1181
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1182
0, 0, 0, 0, 0, 0, 15, 0, 0, 15,
1183
16, 0, 0, 16, 0, 0, 15, 0, 0, 15,
1184
16, 0, 0, 16, 0, 0, 0, 0, 0, 0,
1185
0, 0, 165, 0, 0, 0, 0, 0, 0, 0,
1186
0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
1187
0, 0, 0, 0, 0, 83, 57, 0, 0, 0,
1188
0, 0, 0, 0, 0, 166, 0, 0, 0, 0,
1189
0, 0, 84, 17, 18, 0, 17, 18, 61, 62,
1190
63, 0, 0, 17, 18, 0, 17, 18, 0, 0,
1191
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1192
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1193
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1194
0, 0, 0, 0, 19, 0, 20, 19, 0, 20,
1195
0, 0, 0, 0, 47, 0, 20, 47, 0, 20,
1196
0, 0, 0, 75, 76, 0, 0, 0, 0, 21,
1197
22, 23, 21, 22, 23, 89, 0, 0, 24, 21,
1198
22, 24, 21, 22, 77, 78, 93, 0, 24, 0,
1199
0, 24, 25, 0, 0, 25, 58, 0, 155, 0,
1200
151, 0, 25, 0, 0, 25
1203
#define yypact_value_is_default(yystate) \
1204
((yystate) == (-333))
1206
#define yytable_value_is_error(yytable_value) \
1209
static const yytype_int16 yycheck[] =
1211
25, 4, 20, 53, 23, 138, 53, 31, 64, 75,
1212
145, 153, 225, 53, 141, 23, 53, 24, 273, 324,
1213
351, 352, 15, 355, 151, 40, 41, 359, 21, 22,
1214
297, 362, 25, 356, 161, 358, 178, 79, 80, 81,
1215
356, 176, 358, 50, 72, 73, 351, 64, 65, 66,
1216
67, 0, 354, 70, 71, 56, 57, 58, 108, 324,
1217
358, 108, 324, 355, 359, 207, 208, 43, 108, 324,
1218
212, 213, 225, 324, 358, 100, 83, 59, 60, 61,
1219
62, 63, 74, 75, 76, 77, 78, 359, 138, 324,
1220
324, 355, 225, 359, 324, 43, 356, 338, 324, 355,
1221
358, 358, 273, 273, 210, 170, 359, 359, 11, 157,
1222
167, 37, 87, 139, 135, 94, 84, -1, 43, -1,
1223
-1, -1, -1, -1, -1, 338, -1, -1, 135, 271,
1224
272, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1225
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1226
-1, -1, -1, -1, -1, -1, 206, -1, -1, 206,
1227
210, -1, -1, 210, -1, -1, 206, -1, -1, 206,
1228
210, -1, -1, 210, -1, -1, -1, -1, -1, -1,
1229
-1, -1, 206, -1, -1, -1, -1, -1, -1, -1,
1230
-1, -1, -1, -1, -1, -1, -1, -1, -1, 265,
1231
-1, -1, -1, -1, -1, 338, 224, -1, -1, -1,
1232
-1, -1, -1, -1, -1, 239, -1, -1, -1, -1,
1233
-1, -1, 355, 273, 274, -1, 273, 274, 363, 364,
1234
365, -1, -1, 273, 274, -1, 273, 274, -1, -1,
1235
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1236
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1237
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1238
-1, -1, -1, -1, 324, -1, 326, 324, -1, 326,
1239
-1, -1, -1, -1, 324, -1, 326, 324, -1, 326,
1240
-1, -1, -1, 349, 350, -1, -1, -1, -1, 349,
1241
350, 351, 349, 350, 351, 324, -1, -1, 358, 349,
1242
350, 358, 349, 350, 370, 371, 324, -1, 358, -1,
1243
-1, 358, 372, -1, -1, 372, 344, -1, 331, -1,
1244
355, -1, 372, -1, -1, 372
1247
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1248
symbol of state STATE-NUM. */
1249
static const yytype_uint16 yystos[] =
1251
0, 75, 265, 374, 375, 376, 377, 384, 385, 297,
1252
0, 354, 53, 108, 138, 206, 210, 273, 274, 324,
1253
326, 349, 350, 351, 358, 372, 391, 392, 393, 394,
1254
395, 396, 397, 398, 399, 400, 403, 406, 407, 408,
1255
409, 324, 375, 358, 324, 404, 405, 324, 399, 356,
1256
358, 401, 399, 399, 391, 399, 20, 224, 344, 145,
1257
176, 363, 364, 365, 153, 178, 207, 208, 212, 213,
1258
271, 272, 40, 41, 64, 349, 350, 370, 371, 351,
1259
352, 362, 225, 338, 355, 386, 387, 403, 23, 324,
1260
378, 408, 23, 324, 355, 356, 324, 351, 391, 402,
1261
359, 392, 392, 392, 393, 393, 393, 393, 393, 394,
1262
394, 394, 394, 394, 394, 396, 396, 397, 397, 397,
1263
397, 397, 398, 398, 398, 43, 391, 407, 225, 386,
1264
324, 358, 359, 324, 405, 355, 359, 273, 324, 388,
1265
389, 43, 324, 379, 380, 391, 402, 356, 387, 25,
1266
100, 355, 390, 388, 4, 331, 383, 355, 359, 324,
1267
388, 355, 358, 358, 31, 206, 239, 381, 382, 380,
1268
388, 273, 273, 210, 170, 382, 359, 359
1271
#define yyerrok (yyerrstatus = 0)
1272
#define yyclearin (yychar = YYEMPTY)
1273
#define YYEMPTY (-2)
1276
#define YYACCEPT goto yyacceptlab
1277
#define YYABORT goto yyabortlab
1278
#define YYERROR goto yyerrorlab
1281
/* Like YYERROR except do call yyerror. This remains here temporarily
1282
to ease the transition to the new meaning of YYERROR, for GCC.
1283
Once GCC version 2 has supplanted version 1, this can go. However,
1284
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1285
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1288
#define YYFAIL goto yyerrlab
1290
/* This is here to suppress warnings from the GCC cpp's
1291
-Wunused-macros. Normally we don't worry about that warning, but
1292
some users do, and we want to make it easy for users to remove
1293
YYFAIL uses, which will produce warnings from Bison 2.5. */
1296
#define YYRECOVERING() (!!yyerrstatus)
1298
#define YYBACKUP(Token, Value) \
1300
if (yychar == YYEMPTY && yylen == 1) \
1309
yyerror (YY_("syntax error: cannot back up")); \
1316
#define YYERRCODE 256
1319
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1320
If N is 0, then set CURRENT to the empty location which ends
1321
the previous symbol: RHS[0] (always defined). */
1323
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1324
#ifndef YYLLOC_DEFAULT
1325
# define YYLLOC_DEFAULT(Current, Rhs, N) \
1329
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1330
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1331
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1332
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1336
(Current).first_line = (Current).last_line = \
1337
YYRHSLOC (Rhs, 0).last_line; \
1338
(Current).first_column = (Current).last_column = \
1339
YYRHSLOC (Rhs, 0).last_column; \
1345
/* This macro is provided for backward compatibility. */
1347
#ifndef YY_LOCATION_PRINT
1348
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1352
/* YYLEX -- calling `yylex' with the right arguments. */
1355
# define YYLEX yylex (YYLEX_PARAM)
1357
# define YYLEX yylex ()
1360
/* Enable debugging if requested. */
1364
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1365
# define YYFPRINTF fprintf
1368
# define YYDPRINTF(Args) \
1374
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1378
YYFPRINTF (stderr, "%s ", Title); \
1379
yy_symbol_print (stderr, \
1381
YYFPRINTF (stderr, "\n"); \
1386
/*--------------------------------.
1387
| Print this symbol on YYOUTPUT. |
1388
`--------------------------------*/
1391
#if (defined __STDC__ || defined __C99__FUNC__ \
1392
|| defined __cplusplus || defined _MSC_VER)
1394
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1397
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1400
YYSTYPE const * const yyvaluep;
1406
if (yytype < YYNTOKENS)
1407
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1419
/*--------------------------------.
1420
| Print this symbol on YYOUTPUT. |
1421
`--------------------------------*/
1423
#if (defined __STDC__ || defined __C99__FUNC__ \
1424
|| defined __cplusplus || defined _MSC_VER)
1426
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1429
yy_symbol_print (yyoutput, yytype, yyvaluep)
1432
YYSTYPE const * const yyvaluep;
1435
if (yytype < YYNTOKENS)
1436
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1438
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1440
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1441
YYFPRINTF (yyoutput, ")");
1444
/*------------------------------------------------------------------.
1445
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1447
`------------------------------------------------------------------*/
1449
#if (defined __STDC__ || defined __C99__FUNC__ \
1450
|| defined __cplusplus || defined _MSC_VER)
1452
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1455
yy_stack_print (yybottom, yytop)
1456
yytype_int16 *yybottom;
1457
yytype_int16 *yytop;
1460
YYFPRINTF (stderr, "Stack now");
1461
for (; yybottom <= yytop; yybottom++)
1463
int yybot = *yybottom;
1464
YYFPRINTF (stderr, " %d", yybot);
1466
YYFPRINTF (stderr, "\n");
1469
# define YY_STACK_PRINT(Bottom, Top) \
1472
yy_stack_print ((Bottom), (Top)); \
1476
/*------------------------------------------------.
1477
| Report that the YYRULE is going to be reduced. |
1478
`------------------------------------------------*/
1480
#if (defined __STDC__ || defined __C99__FUNC__ \
1481
|| defined __cplusplus || defined _MSC_VER)
1483
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1486
yy_reduce_print (yyvsp, yyrule)
1491
int yynrhs = yyr2[yyrule];
1493
unsigned long int yylno = yyrline[yyrule];
1494
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1496
/* The symbols being reduced. */
1497
for (yyi = 0; yyi < yynrhs; yyi++)
1499
YYFPRINTF (stderr, " $%d = ", yyi + 1);
1500
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1501
&(yyvsp[(yyi + 1) - (yynrhs)])
1503
YYFPRINTF (stderr, "\n");
1507
# define YY_REDUCE_PRINT(Rule) \
1510
yy_reduce_print (yyvsp, Rule); \
1513
/* Nonzero means print parse trace. It is left uninitialized so that
1514
multiple parsers can coexist. */
1516
#else /* !YYDEBUG */
1517
# define YYDPRINTF(Args)
1518
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1519
# define YY_STACK_PRINT(Bottom, Top)
1520
# define YY_REDUCE_PRINT(Rule)
1521
#endif /* !YYDEBUG */
1524
/* YYINITDEPTH -- initial size of the parser's stacks. */
1526
# define YYINITDEPTH 200
1529
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1530
if the built-in stack extension method is used).
1532
Do not make this value too large; the results are undefined if
1533
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1534
evaluated with infinite-precision integer arithmetic. */
1537
# define YYMAXDEPTH 10000
1544
# if defined __GLIBC__ && defined _STRING_H
1545
# define yystrlen strlen
1547
/* Return the length of YYSTR. */
1548
#if (defined __STDC__ || defined __C99__FUNC__ \
1549
|| defined __cplusplus || defined _MSC_VER)
1551
yystrlen (const char *yystr)
1559
for (yylen = 0; yystr[yylen]; yylen++)
1567
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1568
# define yystpcpy stpcpy
1570
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1572
#if (defined __STDC__ || defined __C99__FUNC__ \
1573
|| defined __cplusplus || defined _MSC_VER)
1575
yystpcpy (char *yydest, const char *yysrc)
1578
yystpcpy (yydest, yysrc)
1584
const char *yys = yysrc;
1586
while ((*yyd++ = *yys++) != '\0')
1595
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1596
quotes and backslashes, so that it's suitable for yyerror. The
1597
heuristic is that double-quoting is unnecessary unless the string
1598
contains an apostrophe, a comma, or backslash (other than
1599
backslash-backslash). YYSTR is taken from yytname. If YYRES is
1600
null, do not copy; instead, return the length of what the result
1603
yytnamerr (char *yyres, const char *yystr)
1608
char const *yyp = yystr;
1615
goto do_not_strip_quotes;
1619
goto do_not_strip_quotes;
1632
do_not_strip_quotes: ;
1636
return yystrlen (yystr);
1638
return yystpcpy (yyres, yystr) - yyres;
1642
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1643
about the unexpected token YYTOKEN for the state stack whose top is
1646
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1647
not large enough to hold the message. In that case, also set
1648
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
1649
required number of bytes is too large to store. */
1651
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1652
yytype_int16 *yyssp, int yytoken)
1654
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1655
YYSIZE_T yysize = yysize0;
1657
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1658
/* Internationalized format string. */
1659
const char *yyformat = 0;
1660
/* Arguments of yyformat. */
1661
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1662
/* Number of reported tokens (one for the "unexpected", one per
1666
/* There are many possibilities here to consider:
1667
- Assume YYFAIL is not used. It's too flawed to consider. See
1668
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1669
for details. YYERROR is fine as it does not invoke this
1671
- If this state is a consistent state with a default action, then
1672
the only way this function was invoked is if the default action
1673
is an error action. In that case, don't check for expected
1674
tokens because there are none.
1675
- The only way there can be no lookahead present (in yychar) is if
1676
this state is a consistent state with a default action. Thus,
1677
detecting the absence of a lookahead is sufficient to determine
1678
that there is no unexpected or expected token to report. In that
1679
case, just report a simple "syntax error".
1680
- Don't assume there isn't a lookahead just because this state is a
1681
consistent state with a default action. There might have been a
1682
previous inconsistent state, consistent state with a non-default
1683
action, or user semantic action that manipulated yychar.
1684
- Of course, the expected token list depends on states to have
1685
correct lookahead information, and it depends on the parser not
1686
to perform extra reductions after fetching a lookahead from the
1687
scanner and before detecting a syntax error. Thus, state merging
1688
(from LALR or IELR) and default reductions corrupt the expected
1689
token list. However, the list is correct for canonical LR with
1690
one exception: it will still contain any token that will not be
1691
accepted due to an error action in a later state.
1693
if (yytoken != YYEMPTY)
1695
int yyn = yypact[*yyssp];
1696
yyarg[yycount++] = yytname[yytoken];
1697
if (!yypact_value_is_default (yyn))
1699
/* Start YYX at -YYN if negative to avoid negative indexes in
1700
YYCHECK. In other words, skip the first -YYN actions for
1701
this state because they are default actions. */
1702
int yyxbegin = yyn < 0 ? -yyn : 0;
1703
/* Stay within bounds of both yycheck and yytname. */
1704
int yychecklim = YYLAST - yyn + 1;
1705
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1708
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1709
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1710
&& !yytable_value_is_error (yytable[yyx + yyn]))
1712
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1718
yyarg[yycount++] = yytname[yyx];
1719
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1720
if (! (yysize <= yysize1
1721
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1730
# define YYCASE_(N, S) \
1734
YYCASE_(0, YY_("syntax error"));
1735
YYCASE_(1, YY_("syntax error, unexpected %s"));
1736
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1737
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1738
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1739
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1743
yysize1 = yysize + yystrlen (yyformat);
1744
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1748
if (*yymsg_alloc < yysize)
1750
*yymsg_alloc = 2 * yysize;
1751
if (! (yysize <= *yymsg_alloc
1752
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1753
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1757
/* Avoid sprintf, as that infringes on the user's name space.
1758
Don't have undefined behavior even if the translation
1759
produced a string with the wrong number of "%s"s. */
1763
while ((*yyp = *yyformat) != '\0')
1764
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1766
yyp += yytnamerr (yyp, yyarg[yyi++]);
1777
#endif /* YYERROR_VERBOSE */
1779
/*-----------------------------------------------.
1780
| Release the memory associated to this symbol. |
1781
`-----------------------------------------------*/
1784
#if (defined __STDC__ || defined __C99__FUNC__ \
1785
|| defined __cplusplus || defined _MSC_VER)
1787
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1790
yydestruct (yymsg, yytype, yyvaluep)
1800
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1811
/* Prevent warnings from -Wmissing-prototypes. */
1812
#ifdef YYPARSE_PARAM
1813
#if defined __STDC__ || defined __cplusplus
1814
int yyparse (void *YYPARSE_PARAM);
1818
#else /* ! YYPARSE_PARAM */
1819
#if defined __STDC__ || defined __cplusplus
1824
#endif /* ! YYPARSE_PARAM */
1827
/* The lookahead symbol. */
1830
/* The semantic value of the lookahead symbol. */
1833
/* Number of syntax errors so far. */
1841
#ifdef YYPARSE_PARAM
1842
#if (defined __STDC__ || defined __C99__FUNC__ \
1843
|| defined __cplusplus || defined _MSC_VER)
1845
yyparse (void *YYPARSE_PARAM)
1848
yyparse (YYPARSE_PARAM)
1849
void *YYPARSE_PARAM;
1851
#else /* ! YYPARSE_PARAM */
1852
#if (defined __STDC__ || defined __C99__FUNC__ \
1853
|| defined __cplusplus || defined _MSC_VER)
1864
/* Number of tokens to shift before error messages enabled. */
1867
/* The stacks and their tools:
1868
`yyss': related to states.
1869
`yyvs': related to semantic values.
1871
Refer to the stacks thru separate pointers, to allow yyoverflow
1872
to reallocate them elsewhere. */
1874
/* The state stack. */
1875
yytype_int16 yyssa[YYINITDEPTH];
1877
yytype_int16 *yyssp;
1879
/* The semantic value stack. */
1880
YYSTYPE yyvsa[YYINITDEPTH];
1884
YYSIZE_T yystacksize;
1888
/* Lookahead token as an internal (translated) token number. */
1890
/* The variables used to return semantic value and location from the
1895
/* Buffer for error messages, and its allocated size. */
1897
char *yymsg = yymsgbuf;
1898
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1901
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1903
/* The number of symbols on the RHS of the reduced rule.
1904
Keep to zero when no symbol should be popped. */
1910
yystacksize = YYINITDEPTH;
1912
YYDPRINTF ((stderr, "Starting parse\n"));
1917
yychar = YYEMPTY; /* Cause a token to be read. */
1919
/* Initialize stack pointers.
1920
Waste one element of value and location stack
1921
so that they stay on the same level as the state stack.
1922
The wasted elements are never initialized. */
1928
/*------------------------------------------------------------.
1929
| yynewstate -- Push a new state, which is found in yystate. |
1930
`------------------------------------------------------------*/
1932
/* In all cases, when you get here, the value and location stacks
1933
have just been pushed. So pushing a state here evens the stacks. */
1939
if (yyss + yystacksize - 1 <= yyssp)
1941
/* Get the current used size of the three stacks, in elements. */
1942
YYSIZE_T yysize = yyssp - yyss + 1;
1946
/* Give user a chance to reallocate the stack. Use copies of
1947
these so that the &'s don't force the real ones into
1949
YYSTYPE *yyvs1 = yyvs;
1950
yytype_int16 *yyss1 = yyss;
1952
/* Each stack pointer address is followed by the size of the
1953
data in use in that stack, in bytes. This used to be a
1954
conditional around just the two extra args, but that might
1955
be undefined if yyoverflow is a macro. */
1956
yyoverflow (YY_("memory exhausted"),
1957
&yyss1, yysize * sizeof (*yyssp),
1958
&yyvs1, yysize * sizeof (*yyvsp),
1964
#else /* no yyoverflow */
1965
# ifndef YYSTACK_RELOCATE
1966
goto yyexhaustedlab;
1968
/* Extend the stack our own way. */
1969
if (YYMAXDEPTH <= yystacksize)
1970
goto yyexhaustedlab;
1972
if (YYMAXDEPTH < yystacksize)
1973
yystacksize = YYMAXDEPTH;
1976
yytype_int16 *yyss1 = yyss;
1977
union yyalloc *yyptr =
1978
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1980
goto yyexhaustedlab;
1981
YYSTACK_RELOCATE (yyss_alloc, yyss);
1982
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1983
# undef YYSTACK_RELOCATE
1985
YYSTACK_FREE (yyss1);
1988
#endif /* no yyoverflow */
1990
yyssp = yyss + yysize - 1;
1991
yyvsp = yyvs + yysize - 1;
1993
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1994
(unsigned long int) yystacksize));
1996
if (yyss + yystacksize - 1 <= yyssp)
2000
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2002
if (yystate == YYFINAL)
2012
/* Do appropriate processing given the current state. Read a
2013
lookahead token if we need one and don't already have one. */
2015
/* First try to decide what to do without reference to lookahead token. */
2016
yyn = yypact[yystate];
2017
if (yypact_value_is_default (yyn))
2020
/* Not known => get a lookahead token if don't already have one. */
2022
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2023
if (yychar == YYEMPTY)
2025
YYDPRINTF ((stderr, "Reading a token: "));
2029
if (yychar <= YYEOF)
2031
yychar = yytoken = YYEOF;
2032
YYDPRINTF ((stderr, "Now at end of input.\n"));
2036
yytoken = YYTRANSLATE (yychar);
2037
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2040
/* If the proper action on seeing token YYTOKEN is to reduce or to
2041
detect an error, take that action. */
2043
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2048
if (yytable_value_is_error (yyn))
2054
/* Count tokens shifted since error; after three, turn off error
2059
/* Shift the lookahead token. */
2060
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2062
/* Discard the shifted token. */
2071
/*-----------------------------------------------------------.
2072
| yydefault -- do the default action for the current state. |
2073
`-----------------------------------------------------------*/
2075
yyn = yydefact[yystate];
2081
/*-----------------------------.
2082
| yyreduce -- Do a reduction. |
2083
`-----------------------------*/
2085
/* yyn is the number of a rule to reduce with. */
2088
/* If YYLEN is nonzero, implement the default value of the action:
2091
Otherwise, the following line sets YYVAL to garbage.
2092
This behavior is undocumented and Bison
2093
users should not rely upon it. Assigning to YYVAL
2094
unconditionally makes the parser a bit smaller, and it avoids a
2095
GCC warning that YYVAL may be used uninitialized. */
2096
yyval = yyvsp[1-yylen];
2099
YY_REDUCE_PRINT (yyn);
2104
/* Line 1806 of yacc.c */
2105
#line 584 "sqlparser.y"
2107
//todo: multiple statements
2108
//todo: not only "select" statements
2109
parser->setOperation(Parser::OP_Select);
2110
parser->setQuerySchema((yyvsp[(1) - (1)].querySchema));
2116
/* Line 1806 of yacc.c */
2117
#line 594 "sqlparser.y"
2119
//todo: multiple statements
2125
/* Line 1806 of yacc.c */
2126
#line 599 "sqlparser.y"
2128
(yyval.querySchema) = (yyvsp[(1) - (2)].querySchema);
2134
/* Line 1806 of yacc.c */
2135
#line 609 "sqlparser.y"
2143
/* Line 1806 of yacc.c */
2144
#line 613 "sqlparser.y"
2146
(yyval.querySchema) = (yyvsp[(1) - (1)].querySchema);
2152
/* Line 1806 of yacc.c */
2153
#line 620 "sqlparser.y"
2155
parser->setOperation(Parser::OP_CreateTable);
2156
parser->createTable((yyvsp[(3) - (3)].stringValue)->toLatin1());
2157
delete (yyvsp[(3) - (3)].stringValue);
2163
/* Line 1806 of yacc.c */
2164
#line 630 "sqlparser.y"
2171
/* Line 1806 of yacc.c */
2172
#line 636 "sqlparser.y"
2174
KexiDBDbg << "adding field " << *(yyvsp[(1) - (2)].stringValue);
2175
field->setName((yyvsp[(1) - (2)].stringValue)->toLatin1());
2176
parser->table()->addField(field);
2178
delete (yyvsp[(1) - (2)].stringValue);
2184
/* Line 1806 of yacc.c */
2185
#line 644 "sqlparser.y"
2187
KexiDBDbg << "adding field " << *(yyvsp[(1) - (3)].stringValue);
2188
field->setName(*(yyvsp[(1) - (3)].stringValue));
2189
delete (yyvsp[(1) - (3)].stringValue);
2190
parser->table()->addField(field);
2192
// if(field->isPrimaryKey())
2193
// parser->table()->addPrimaryKey(field->name());
2202
/* Line 1806 of yacc.c */
2203
#line 660 "sqlparser.y"
2210
/* Line 1806 of yacc.c */
2211
#line 666 "sqlparser.y"
2213
field->setPrimaryKey(true);
2214
KexiDBDbg << "primary";
2220
/* Line 1806 of yacc.c */
2221
#line 671 "sqlparser.y"
2223
field->setNotNull(true);
2224
KexiDBDbg << "not_null";
2230
/* Line 1806 of yacc.c */
2231
#line 676 "sqlparser.y"
2233
field->setAutoIncrement(true);
2234
KexiDBDbg << "ainc";
2240
/* Line 1806 of yacc.c */
2241
#line 684 "sqlparser.y"
2243
field = new Field();
2244
field->setType((yyvsp[(1) - (1)].colType));
2250
/* Line 1806 of yacc.c */
2251
#line 689 "sqlparser.y"
2253
KexiDBDbg << "sql + length";
2254
field = new Field();
2255
field->setPrecision((yyvsp[(3) - (4)].integerValue));
2256
field->setType((yyvsp[(1) - (4)].colType));
2262
/* Line 1806 of yacc.c */
2263
#line 696 "sqlparser.y"
2265
field = new Field();
2266
field->setPrecision((yyvsp[(3) - (4)].integerValue));
2267
field->setType(Field::Text);
2273
/* Line 1806 of yacc.c */
2274
#line 702 "sqlparser.y"
2276
// SQLITE compatibillity
2277
field = new Field();
2278
field->setType(Field::InvalidType);
2284
/* Line 1806 of yacc.c */
2285
#line 711 "sqlparser.y"
2287
KexiDBDbg << "Select ColViews=" << (yyvsp[(2) - (2)].exprList)->debugString();
2289
if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), (yyvsp[(2) - (2)].exprList) )))
2296
/* Line 1806 of yacc.c */
2297
#line 718 "sqlparser.y"
2299
if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), (yyvsp[(3) - (3)].exprList) )))
2306
/* Line 1806 of yacc.c */
2307
#line 723 "sqlparser.y"
2309
KexiDBDbg << "Select ColViews Tables";
2310
if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (2)].querySchema), 0, (yyvsp[(2) - (2)].exprList) )))
2317
/* Line 1806 of yacc.c */
2318
#line 729 "sqlparser.y"
2320
KexiDBDbg << "Select ColViews Conditions";
2321
if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (3)].querySchema), (yyvsp[(2) - (3)].exprList), 0, (yyvsp[(3) - (3)].selectOptions) )))
2328
/* Line 1806 of yacc.c */
2329
#line 735 "sqlparser.y"
2331
KexiDBDbg << "Select ColViews Tables SelectOptions";
2332
if (!((yyval.querySchema) = buildSelectQuery( (yyvsp[(1) - (4)].querySchema), (yyvsp[(2) - (4)].exprList), (yyvsp[(3) - (4)].exprList), (yyvsp[(4) - (4)].selectOptions) )))
2339
/* Line 1806 of yacc.c */
2340
#line 744 "sqlparser.y"
2342
KexiDBDbg << "SELECT";
2343
// parser->createSelect();
2344
// parser->setOperation(Parser::OP_Select);
2345
(yyval.querySchema) = new QuerySchema();
2351
/* Line 1806 of yacc.c */
2352
#line 754 "sqlparser.y"
2354
KexiDBDbg << "WhereClause";
2355
(yyval.selectOptions) = new SelectOptionsInternal;
2356
(yyval.selectOptions)->whereExpr = (yyvsp[(1) - (1)].expr);
2362
/* Line 1806 of yacc.c */
2363
#line 760 "sqlparser.y"
2365
KexiDBDbg << "OrderByClause";
2366
(yyval.selectOptions) = new SelectOptionsInternal;
2367
(yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (3)].orderByColumns);
2373
/* Line 1806 of yacc.c */
2374
#line 766 "sqlparser.y"
2376
KexiDBDbg << "WhereClause ORDER BY OrderByClause";
2377
(yyval.selectOptions) = new SelectOptionsInternal;
2378
(yyval.selectOptions)->whereExpr = (yyvsp[(1) - (4)].expr);
2379
(yyval.selectOptions)->orderByColumns = (yyvsp[(4) - (4)].orderByColumns);
2385
/* Line 1806 of yacc.c */
2386
#line 773 "sqlparser.y"
2388
KexiDBDbg << "OrderByClause WhereClause";
2389
(yyval.selectOptions) = new SelectOptionsInternal;
2390
(yyval.selectOptions)->whereExpr = (yyvsp[(4) - (4)].expr);
2391
(yyval.selectOptions)->orderByColumns = (yyvsp[(3) - (4)].orderByColumns);
2397
/* Line 1806 of yacc.c */
2398
#line 783 "sqlparser.y"
2400
(yyval.expr) = (yyvsp[(2) - (2)].expr);
2406
/* Line 1806 of yacc.c */
2407
#line 792 "sqlparser.y"
2409
KexiDBDbg << "ORDER BY IDENTIFIER";
2410
(yyval.orderByColumns) = new OrderByColumnInternal::List;
2411
OrderByColumnInternal orderByColumn;
2412
orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (1)].variantValue) );
2413
(yyval.orderByColumns)->append( orderByColumn );
2414
delete (yyvsp[(1) - (1)].variantValue);
2420
/* Line 1806 of yacc.c */
2421
#line 801 "sqlparser.y"
2423
KexiDBDbg << "ORDER BY IDENTIFIER OrderByOption";
2424
(yyval.orderByColumns) = new OrderByColumnInternal::List;
2425
OrderByColumnInternal orderByColumn;
2426
orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (2)].variantValue) );
2427
orderByColumn.ascending = (yyvsp[(2) - (2)].booleanValue);
2428
(yyval.orderByColumns)->append( orderByColumn );
2429
delete (yyvsp[(1) - (2)].variantValue);
2435
/* Line 1806 of yacc.c */
2436
#line 811 "sqlparser.y"
2438
(yyval.orderByColumns) = (yyvsp[(3) - (3)].orderByColumns);
2439
OrderByColumnInternal orderByColumn;
2440
orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (3)].variantValue) );
2441
(yyval.orderByColumns)->append( orderByColumn );
2442
delete (yyvsp[(1) - (3)].variantValue);
2448
/* Line 1806 of yacc.c */
2449
#line 819 "sqlparser.y"
2451
(yyval.orderByColumns) = (yyvsp[(4) - (4)].orderByColumns);
2452
OrderByColumnInternal orderByColumn;
2453
orderByColumn.setColumnByNameOrNumber( *(yyvsp[(1) - (4)].variantValue) );
2454
orderByColumn.ascending = (yyvsp[(2) - (4)].booleanValue);
2455
(yyval.orderByColumns)->append( orderByColumn );
2456
delete (yyvsp[(1) - (4)].variantValue);
2462
/* Line 1806 of yacc.c */
2463
#line 831 "sqlparser.y"
2465
(yyval.variantValue) = new QVariant( *(yyvsp[(1) - (1)].stringValue) );
2466
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue);
2467
delete (yyvsp[(1) - (1)].stringValue);
2473
/* Line 1806 of yacc.c */
2474
#line 837 "sqlparser.y"
2476
(yyval.variantValue) = new QVariant( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
2477
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue);
2478
delete (yyvsp[(1) - (3)].stringValue);
2479
delete (yyvsp[(3) - (3)].stringValue);
2485
/* Line 1806 of yacc.c */
2486
#line 844 "sqlparser.y"
2488
(yyval.variantValue) = new QVariant((yyvsp[(1) - (1)].integerValue));
2489
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue);
2495
/* Line 1806 of yacc.c */
2496
#line 851 "sqlparser.y"
2498
(yyval.booleanValue) = true;
2504
/* Line 1806 of yacc.c */
2505
#line 855 "sqlparser.y"
2507
(yyval.booleanValue) = false;
2513
/* Line 1806 of yacc.c */
2514
#line 867 "sqlparser.y"
2516
// KexiDBDbg << "AND " << $3.debugString();
2517
(yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), AND, (yyvsp[(3) - (3)].expr) );
2523
/* Line 1806 of yacc.c */
2524
#line 872 "sqlparser.y"
2526
(yyval.expr) = new BinaryExpr( KexiDBExpr_Logical, (yyvsp[(1) - (3)].expr), OR, (yyvsp[(3) - (3)].expr) );
2532
/* Line 1806 of yacc.c */
2533
#line 876 "sqlparser.y"
2535
(yyval.expr) = new BinaryExpr( KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), XOR, (yyvsp[(3) - (3)].expr) );
2541
/* Line 1806 of yacc.c */
2542
#line 886 "sqlparser.y"
2544
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '>', (yyvsp[(3) - (3)].expr));
2550
/* Line 1806 of yacc.c */
2551
#line 890 "sqlparser.y"
2553
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), GREATER_OR_EQUAL, (yyvsp[(3) - (3)].expr));
2559
/* Line 1806 of yacc.c */
2560
#line 894 "sqlparser.y"
2562
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '<', (yyvsp[(3) - (3)].expr));
2568
/* Line 1806 of yacc.c */
2569
#line 898 "sqlparser.y"
2571
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LESS_OR_EQUAL, (yyvsp[(3) - (3)].expr));
2577
/* Line 1806 of yacc.c */
2578
#line 902 "sqlparser.y"
2580
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), '=', (yyvsp[(3) - (3)].expr));
2586
/* Line 1806 of yacc.c */
2587
#line 912 "sqlparser.y"
2589
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL, (yyvsp[(3) - (3)].expr));
2595
/* Line 1806 of yacc.c */
2596
#line 917 "sqlparser.y"
2598
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_EQUAL2, (yyvsp[(3) - (3)].expr));
2604
/* Line 1806 of yacc.c */
2605
#line 921 "sqlparser.y"
2607
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), LIKE, (yyvsp[(3) - (3)].expr));
2613
/* Line 1806 of yacc.c */
2614
#line 925 "sqlparser.y"
2616
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SQL_IN, (yyvsp[(3) - (3)].expr));
2622
/* Line 1806 of yacc.c */
2623
#line 929 "sqlparser.y"
2625
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), SIMILAR_TO, (yyvsp[(3) - (3)].expr));
2631
/* Line 1806 of yacc.c */
2632
#line 933 "sqlparser.y"
2634
(yyval.expr) = new BinaryExpr(KexiDBExpr_Relational, (yyvsp[(1) - (3)].expr), NOT_SIMILAR_TO, (yyvsp[(3) - (3)].expr));
2640
/* Line 1806 of yacc.c */
2641
#line 943 "sqlparser.y"
2643
(yyval.expr) = new UnaryExpr( SQL_IS_NULL, (yyvsp[(1) - (2)].expr) );
2649
/* Line 1806 of yacc.c */
2650
#line 947 "sqlparser.y"
2652
(yyval.expr) = new UnaryExpr( SQL_IS_NOT_NULL, (yyvsp[(1) - (2)].expr) );
2658
/* Line 1806 of yacc.c */
2659
#line 957 "sqlparser.y"
2661
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_LEFT, (yyvsp[(3) - (3)].expr));
2667
/* Line 1806 of yacc.c */
2668
#line 961 "sqlparser.y"
2670
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), BITWISE_SHIFT_RIGHT, (yyvsp[(3) - (3)].expr));
2676
/* Line 1806 of yacc.c */
2677
#line 971 "sqlparser.y"
2679
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '+', (yyvsp[(3) - (3)].expr));
2680
(yyval.expr)->debug();
2686
/* Line 1806 of yacc.c */
2687
#line 976 "sqlparser.y"
2689
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), CONCATENATION, (yyvsp[(3) - (3)].expr));
2695
/* Line 1806 of yacc.c */
2696
#line 980 "sqlparser.y"
2698
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '-', (yyvsp[(3) - (3)].expr));
2704
/* Line 1806 of yacc.c */
2705
#line 984 "sqlparser.y"
2707
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '&', (yyvsp[(3) - (3)].expr));
2713
/* Line 1806 of yacc.c */
2714
#line 988 "sqlparser.y"
2716
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '|', (yyvsp[(3) - (3)].expr));
2722
/* Line 1806 of yacc.c */
2723
#line 998 "sqlparser.y"
2725
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '/', (yyvsp[(3) - (3)].expr));
2731
/* Line 1806 of yacc.c */
2732
#line 1002 "sqlparser.y"
2734
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '*', (yyvsp[(3) - (3)].expr));
2740
/* Line 1806 of yacc.c */
2741
#line 1006 "sqlparser.y"
2743
(yyval.expr) = new BinaryExpr(KexiDBExpr_Arithm, (yyvsp[(1) - (3)].expr), '%', (yyvsp[(3) - (3)].expr));
2749
/* Line 1806 of yacc.c */
2750
#line 1017 "sqlparser.y"
2752
(yyval.expr) = new UnaryExpr( '-', (yyvsp[(2) - (2)].expr) );
2758
/* Line 1806 of yacc.c */
2759
#line 1021 "sqlparser.y"
2761
(yyval.expr) = new UnaryExpr( '+', (yyvsp[(2) - (2)].expr) );
2767
/* Line 1806 of yacc.c */
2768
#line 1025 "sqlparser.y"
2770
(yyval.expr) = new UnaryExpr( '~', (yyvsp[(2) - (2)].expr) );
2776
/* Line 1806 of yacc.c */
2777
#line 1029 "sqlparser.y"
2779
(yyval.expr) = new UnaryExpr( NOT, (yyvsp[(2) - (2)].expr) );
2785
/* Line 1806 of yacc.c */
2786
#line 1033 "sqlparser.y"
2788
(yyval.expr) = new VariableExpr( *(yyvsp[(1) - (1)].stringValue) );
2790
//TODO: simplify this later if that's 'only one field name' expression
2791
KexiDBDbg << " + identifier: " << *(yyvsp[(1) - (1)].stringValue);
2792
delete (yyvsp[(1) - (1)].stringValue);
2798
/* Line 1806 of yacc.c */
2799
#line 1041 "sqlparser.y"
2801
(yyval.expr) = new QueryParameterExpr( *(yyvsp[(1) - (1)].stringValue) );
2802
KexiDBDbg << " + query parameter: " << (yyval.expr)->debugString();
2803
delete (yyvsp[(1) - (1)].stringValue);
2809
/* Line 1806 of yacc.c */
2810
#line 1047 "sqlparser.y"
2812
KexiDBDbg << " + function: " << *(yyvsp[(1) - (2)].stringValue) << "(" << (yyvsp[(2) - (2)].exprList)->debugString() << ")";
2813
(yyval.expr) = new FunctionExpr(*(yyvsp[(1) - (2)].stringValue), (yyvsp[(2) - (2)].exprList));
2814
delete (yyvsp[(1) - (2)].stringValue);
2820
/* Line 1806 of yacc.c */
2821
#line 1054 "sqlparser.y"
2823
(yyval.expr) = new VariableExpr( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
2824
KexiDBDbg << " + identifier.identifier: " << *(yyvsp[(1) - (3)].stringValue) << "." << *(yyvsp[(3) - (3)].stringValue);
2825
delete (yyvsp[(1) - (3)].stringValue);
2826
delete (yyvsp[(3) - (3)].stringValue);
2832
/* Line 1806 of yacc.c */
2833
#line 1061 "sqlparser.y"
2835
(yyval.expr) = new ConstExpr( SQL_NULL, QVariant() );
2836
KexiDBDbg << " + NULL";
2837
// $$ = new Field();
2838
//$$->setName(QString::null);
2844
/* Line 1806 of yacc.c */
2845
#line 1068 "sqlparser.y"
2847
(yyval.expr) = new ConstExpr( CHARACTER_STRING_LITERAL, *(yyvsp[(1) - (1)].stringValue) );
2848
KexiDBDbg << " + constant " << (yyvsp[(1) - (1)].stringValue);
2849
delete (yyvsp[(1) - (1)].stringValue);
2855
/* Line 1806 of yacc.c */
2856
#line 1074 "sqlparser.y"
2859
if ((yyvsp[(1) - (1)].integerValue) <= INT_MAX && (yyvsp[(1) - (1)].integerValue) >= INT_MIN)
2860
val = (int)(yyvsp[(1) - (1)].integerValue);
2861
else if ((yyvsp[(1) - (1)].integerValue) <= UINT_MAX && (yyvsp[(1) - (1)].integerValue) >= 0)
2862
val = (uint)(yyvsp[(1) - (1)].integerValue);
2863
else if ((yyvsp[(1) - (1)].integerValue) <= LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= LLONG_MIN)
2864
val = (qint64)(yyvsp[(1) - (1)].integerValue);
2866
// if ($1 < ULLONG_MAX)
2867
// val = (quint64)$1;
2870
(yyval.expr) = new ConstExpr( INTEGER_CONST, val );
2871
KexiDBDbg << " + int constant: " << val.toString();
2877
/* Line 1806 of yacc.c */
2878
#line 1091 "sqlparser.y"
2880
(yyval.expr) = new ConstExpr( REAL_CONST, QPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) );
2881
KexiDBDbg << " + real constant: " << (yyvsp[(1) - (1)].realValue).integer << "." << (yyvsp[(1) - (1)].realValue).fractional;
2887
/* Line 1806 of yacc.c */
2888
#line 1102 "sqlparser.y"
2890
KexiDBDbg << "(expr)";
2891
(yyval.expr) = new UnaryExpr('(', (yyvsp[(2) - (3)].expr));
2897
/* Line 1806 of yacc.c */
2898
#line 1110 "sqlparser.y"
2900
// $$ = new NArgExpr(0, 0);
2903
(yyval.exprList) = (yyvsp[(2) - (3)].exprList);
2909
/* Line 1806 of yacc.c */
2910
#line 1120 "sqlparser.y"
2912
(yyval.exprList) = (yyvsp[(3) - (3)].exprList);
2913
(yyval.exprList)->prepend( (yyvsp[(1) - (3)].expr) );
2919
/* Line 1806 of yacc.c */
2920
#line 1125 "sqlparser.y"
2922
(yyval.exprList) = new NArgExpr(0, 0);
2923
(yyval.exprList)->add( (yyvsp[(1) - (3)].expr) );
2924
(yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
2930
/* Line 1806 of yacc.c */
2931
#line 1134 "sqlparser.y"
2933
(yyval.exprList) = (yyvsp[(2) - (2)].exprList);
2939
/* Line 1806 of yacc.c */
2940
#line 1179 "sqlparser.y"
2942
(yyval.exprList) = (yyvsp[(1) - (3)].exprList);
2943
(yyval.exprList)->add((yyvsp[(3) - (3)].expr));
2949
/* Line 1806 of yacc.c */
2950
#line 1184 "sqlparser.y"
2952
(yyval.exprList) = new NArgExpr(KexiDBExpr_TableList, IDENTIFIER); //ok?
2953
(yyval.exprList)->add((yyvsp[(1) - (1)].expr));
2959
/* Line 1806 of yacc.c */
2960
#line 1192 "sqlparser.y"
2962
KexiDBDbg << "FROM: '" << *(yyvsp[(1) - (1)].stringValue) << "'";
2963
(yyval.expr) = new VariableExpr(*(yyvsp[(1) - (1)].stringValue));
2966
//TODO: this isn't ok for more tables:
2967
Field::ListIterator it = parser->select()->fieldsIterator();
2968
for(Field *item; (item = it.current()); ++it)
2970
if(item->table() == dummy)
2972
item->setTable(schema);
2975
if(item->table() && !item->isQueryAsterisk())
2977
Field *f = item->table()->field(item->name());
2980
ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'",item->name(),schema->name()), ctoken, current);
2981
parser->setError(err);
2982
yyerror("fieldlisterror");
2986
delete (yyvsp[(1) - (1)].stringValue);
2992
/* Line 1806 of yacc.c */
2993
#line 1220 "sqlparser.y"
2996
(yyval.expr) = new BinaryExpr(
2997
KexiDBExpr_SpecialBinary,
2998
new VariableExpr(*(yyvsp[(1) - (2)].stringValue)), 0,
2999
new VariableExpr(*(yyvsp[(2) - (2)].stringValue))
3001
delete (yyvsp[(1) - (2)].stringValue);
3002
delete (yyvsp[(2) - (2)].stringValue);
3008
/* Line 1806 of yacc.c */
3009
#line 1231 "sqlparser.y"
3012
(yyval.expr) = new BinaryExpr(
3013
KexiDBExpr_SpecialBinary,
3014
new VariableExpr(*(yyvsp[(1) - (3)].stringValue)), AS,
3015
new VariableExpr(*(yyvsp[(3) - (3)].stringValue))
3017
delete (yyvsp[(1) - (3)].stringValue);
3018
delete (yyvsp[(3) - (3)].stringValue);
3024
/* Line 1806 of yacc.c */
3025
#line 1247 "sqlparser.y"
3027
(yyval.exprList) = (yyvsp[(1) - (3)].exprList);
3028
(yyval.exprList)->add( (yyvsp[(3) - (3)].expr) );
3029
KexiDBDbg << "ColViews: ColViews , ColItem";
3035
/* Line 1806 of yacc.c */
3036
#line 1253 "sqlparser.y"
3038
(yyval.exprList) = new NArgExpr(0,0);
3039
(yyval.exprList)->add( (yyvsp[(1) - (1)].expr) );
3040
KexiDBDbg << "ColViews: ColItem";
3046
/* Line 1806 of yacc.c */
3047
#line 1262 "sqlparser.y"
3049
// $$ = new Field();
3050
// dummy->addField($$);
3051
// $$->setExpression( $1 );
3052
// parser->select()->addField($$);
3053
(yyval.expr) = (yyvsp[(1) - (1)].expr);
3054
KexiDBDbg << " added column expr: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'";
3060
/* Line 1806 of yacc.c */
3061
#line 1271 "sqlparser.y"
3063
(yyval.expr) = (yyvsp[(1) - (1)].expr);
3064
KexiDBDbg << " added column wildcard: '" << (yyvsp[(1) - (1)].expr)->debugString() << "'";
3070
/* Line 1806 of yacc.c */
3071
#line 1276 "sqlparser.y"
3073
(yyval.expr) = new BinaryExpr(
3074
KexiDBExpr_SpecialBinary, (yyvsp[(1) - (3)].expr), AS,
3075
new VariableExpr(*(yyvsp[(3) - (3)].stringValue))
3077
KexiDBDbg << " added column expr: " << (yyval.expr)->debugString();
3078
delete (yyvsp[(3) - (3)].stringValue);
3084
/* Line 1806 of yacc.c */
3085
#line 1285 "sqlparser.y"
3087
(yyval.expr) = new BinaryExpr(
3088
KexiDBExpr_SpecialBinary, (yyvsp[(1) - (2)].expr), 0,
3089
new VariableExpr(*(yyvsp[(2) - (2)].stringValue))
3091
KexiDBDbg << " added column expr: " << (yyval.expr)->debugString();
3092
delete (yyvsp[(2) - (2)].stringValue);
3098
/* Line 1806 of yacc.c */
3099
#line 1297 "sqlparser.y"
3101
(yyval.expr) = (yyvsp[(1) - (1)].expr);
3107
/* Line 1806 of yacc.c */
3108
#line 1341 "sqlparser.y"
3110
(yyval.expr) = (yyvsp[(3) - (4)].expr);
3112
// $$->setName("DISTINCT(" + $3->name() + ")");
3118
/* Line 1806 of yacc.c */
3119
#line 1350 "sqlparser.y"
3121
(yyval.expr) = new VariableExpr("*");
3122
KexiDBDbg << "all columns";
3124
// QueryAsterisk *ast = new QueryAsterisk(parser->select(), dummy);
3125
// parser->select()->addAsterisk(ast);
3126
// requiresTable = true;
3132
/* Line 1806 of yacc.c */
3133
#line 1359 "sqlparser.y"
3135
QString s( *(yyvsp[(1) - (3)].stringValue) );
3137
(yyval.expr) = new VariableExpr(s);
3138
KexiDBDbg << " + all columns from " << s;
3139
delete (yyvsp[(1) - (3)].stringValue);
3145
/* Line 1806 of yacc.c */
3146
#line 3147 "sqlparser.cpp"
3149
/* User semantic actions sometimes alter yychar, and that requires
3150
that yytoken be updated with the new translation. We take the
3151
approach of translating immediately before every use of yytoken.
3152
One alternative is translating here after every semantic action,
3153
but that translation would be missed if the semantic action invokes
3154
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3155
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3156
incorrect destructor might then be invoked immediately. In the
3157
case of YYERROR or YYBACKUP, subsequent parser actions might lead
3158
to an incorrect destructor call or verbose syntax error message
3159
before the lookahead is translated. */
3160
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3164
YY_STACK_PRINT (yyss, yyssp);
3168
/* Now `shift' the result of the reduction. Determine what state
3169
that goes to, based on the state we popped back to and the rule
3170
number reduced by. */
3174
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3175
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3176
yystate = yytable[yystate];
3178
yystate = yydefgoto[yyn - YYNTOKENS];
3183
/*------------------------------------.
3184
| yyerrlab -- here on detecting error |
3185
`------------------------------------*/
3187
/* Make sure we have latest lookahead translation. See comments at
3188
user semantic actions for why this is necessary. */
3189
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3191
/* If not already recovering from an error, report this error. */
3195
#if ! YYERROR_VERBOSE
3196
yyerror (YY_("syntax error"));
3198
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3201
char const *yymsgp = YY_("syntax error");
3202
int yysyntax_error_status;
3203
yysyntax_error_status = YYSYNTAX_ERROR;
3204
if (yysyntax_error_status == 0)
3206
else if (yysyntax_error_status == 1)
3208
if (yymsg != yymsgbuf)
3209
YYSTACK_FREE (yymsg);
3210
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3214
yymsg_alloc = sizeof yymsgbuf;
3215
yysyntax_error_status = 2;
3219
yysyntax_error_status = YYSYNTAX_ERROR;
3224
if (yysyntax_error_status == 2)
3225
goto yyexhaustedlab;
3227
# undef YYSYNTAX_ERROR
3233
if (yyerrstatus == 3)
3235
/* If just tried and failed to reuse lookahead token after an
3236
error, discard it. */
3238
if (yychar <= YYEOF)
3240
/* Return failure if at end of input. */
3241
if (yychar == YYEOF)
3246
yydestruct ("Error: discarding",
3252
/* Else will try to reuse lookahead token after shifting the error
3257
/*---------------------------------------------------.
3258
| yyerrorlab -- error raised explicitly by YYERROR. |
3259
`---------------------------------------------------*/
3262
/* Pacify compilers like GCC when the user code never invokes
3263
YYERROR and the label yyerrorlab therefore never appears in user
3265
if (/*CONSTCOND*/ 0)
3268
/* Do not reclaim the symbols of the rule which action triggered
3272
YY_STACK_PRINT (yyss, yyssp);
3277
/*-------------------------------------------------------------.
3278
| yyerrlab1 -- common code for both syntax error and YYERROR. |
3279
`-------------------------------------------------------------*/
3281
yyerrstatus = 3; /* Each real token shifted decrements this. */
3285
yyn = yypact[yystate];
3286
if (!yypact_value_is_default (yyn))
3289
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3297
/* Pop the current state because it cannot handle the error token. */
3302
yydestruct ("Error: popping",
3303
yystos[yystate], yyvsp);
3306
YY_STACK_PRINT (yyss, yyssp);
3312
/* Shift the error token. */
3313
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3319
/*-------------------------------------.
3320
| yyacceptlab -- YYACCEPT comes here. |
3321
`-------------------------------------*/
3326
/*-----------------------------------.
3327
| yyabortlab -- YYABORT comes here. |
3328
`-----------------------------------*/
3333
#if !defined(yyoverflow) || YYERROR_VERBOSE
3334
/*-------------------------------------------------.
3335
| yyexhaustedlab -- memory exhaustion comes here. |
3336
`-------------------------------------------------*/
3338
yyerror (YY_("memory exhausted"));
3344
if (yychar != YYEMPTY)
3346
/* Make sure we have latest lookahead translation. See comments at
3347
user semantic actions for why this is necessary. */
3348
yytoken = YYTRANSLATE (yychar);
3349
yydestruct ("Cleanup: discarding lookahead",
3352
/* Do not reclaim the symbols of the rule which action triggered
3353
this YYABORT or YYACCEPT. */
3355
YY_STACK_PRINT (yyss, yyssp);
3356
while (yyssp != yyss)
3358
yydestruct ("Cleanup: popping",
3359
yystos[*yyssp], yyvsp);
3364
YYSTACK_FREE (yyss);
3367
if (yymsg != yymsgbuf)
3368
YYSTACK_FREE (yymsg);
3370
/* Make sure YYID is used. */
3371
return YYID (yyresult);
3376
/* Line 2067 of yacc.c */
3377
#line 1374 "sqlparser.y"
3381
const char* tname(int offset) { return yytname[offset]; }