/* A Bison parser, made by GNU Bison 2.0. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse sqlparse #define yylex sqllex #define yyerror sqlerror #define yylval sqllval #define yychar sqlchar #define yydebug sqldebug #define yynerrs sqlnerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { L_SELECT = 258, L_FROM = 259, L_WHERE = 260, L_AS = 261, L_ON = 262, L_ORDER = 263, L_BY = 264, L_ORDER_ASC = 265, L_ORDER_DSC = 266, L_DISTINCT = 267, L_BETWEEN = 268, L_IN = 269, L_GROUP = 270, L_INSERT = 271, L_INTO = 272, L_VALUES = 273, L_UPDATE = 274, L_SET = 275, L_DOT = 276, L_COMMA = 277, L_NULL = 278, L_LBRACKET = 279, L_RBRACKET = 280, L_IDENT = 281, L_EQ = 282, L_IS = 283, L_LIKE = 284, L_GT = 285, L_LT = 286, L_GEQ = 287, L_LEQ = 288, L_DIFF = 289, L_REGEXP = 290, L_REGEXP_CI = 291, L_NOTREGEXP = 292, L_NOTREGEXP_CI = 293, L_SIMILAR = 294, L_NOT = 295, L_AND = 296, L_OR = 297, L_MINUS = 298, L_PLUS = 299, L_TIMES = 300, L_DIV = 301, L_STRING = 302, L_TEXTUAL = 303, L_DELETE = 304, L_JOIN = 305, L_INNER = 306, L_LEFT = 307, L_RIGHT = 308, L_FULL = 309, L_OUTER = 310, L_LSBRACKET = 311, L_RSBRACKET = 312, L_PNAME = 313, L_PTYPE = 314, L_PISPARAM = 315, L_PDESCR = 316, L_PNULLOK = 317, L_UNSPECVAL = 318 }; #endif #define L_SELECT 258 #define L_FROM 259 #define L_WHERE 260 #define L_AS 261 #define L_ON 262 #define L_ORDER 263 #define L_BY 264 #define L_ORDER_ASC 265 #define L_ORDER_DSC 266 #define L_DISTINCT 267 #define L_BETWEEN 268 #define L_IN 269 #define L_GROUP 270 #define L_INSERT 271 #define L_INTO 272 #define L_VALUES 273 #define L_UPDATE 274 #define L_SET 275 #define L_DOT 276 #define L_COMMA 277 #define L_NULL 278 #define L_LBRACKET 279 #define L_RBRACKET 280 #define L_IDENT 281 #define L_EQ 282 #define L_IS 283 #define L_LIKE 284 #define L_GT 285 #define L_LT 286 #define L_GEQ 287 #define L_LEQ 288 #define L_DIFF 289 #define L_REGEXP 290 #define L_REGEXP_CI 291 #define L_NOTREGEXP 292 #define L_NOTREGEXP_CI 293 #define L_SIMILAR 294 #define L_NOT 295 #define L_AND 296 #define L_OR 297 #define L_MINUS 298 #define L_PLUS 299 #define L_TIMES 300 #define L_DIV 301 #define L_STRING 302 #define L_TEXTUAL 303 #define L_DELETE 304 #define L_JOIN 305 #define L_INNER 306 #define L_LEFT 307 #define L_RIGHT 308 #define L_FULL 309 #define L_OUTER 310 #define L_LSBRACKET 311 #define L_RSBRACKET 312 #define L_PNAME 313 #define L_PTYPE 314 #define L_PISPARAM 315 #define L_PDESCR 316 #define L_PNULLOK 317 #define L_UNSPECVAL 318 /* Copy the first part of user declarations. */ #line 1 "../libsql/parser.y" #include #include #include #include #include "sql_parser.h" #include "sql_tree.h" #include "mem.h" int sqlerror (char *); int sqllex (); extern sql_statement *sql_result; /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 17 "../libsql/parser.y" typedef union YYSTYPE { void *v; char *str; int i; GList *list; sql_field *f; sql_field_item *fi; sql_table *t; sql_condition *c; sql_where *w; param_spec *ps; sql_order_field *of; } YYSTYPE; /* Line 190 of yacc.c. */ #line 240 "parser.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 213 of yacc.c. */ #line 252 "parser.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # else # define YYSTACK_ALLOC alloca # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short int yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 17 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 244 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 64 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 33 /* YYNRULES -- Number of rules. */ #define YYNRULES 110 /* YYNRULES -- Number of states. */ #define YYNSTATES 198 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 318 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 20, 27, 36, 42, 47, 49, 53, 57, 58, 60, 61, 64, 65, 69, 70, 72, 76, 78, 81, 84, 88, 89, 91, 95, 98, 102, 105, 109, 112, 116, 119, 121, 123, 127, 131, 137, 139, 141, 143, 147, 152, 156, 158, 162, 165, 167, 171, 174, 176, 180, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 208, 210, 214, 219, 223, 225, 229, 233, 236, 241, 243, 246, 250, 254, 258, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 296, 302, 307, 314, 319, 323, 325, 328, 332, 336, 340, 344 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 65, 0, -1, 66, -1, 67, -1, 68, -1, 69, -1, 3, 72, 78, 4, 80, 73, 74, 77, -1, 3, 72, 78, 73, 74, 77, -1, 16, 17, 84, 71, 18, 24, 78, 25, -1, 19, 84, 20, 70, 73, -1, 49, 4, 84, 73, -1, 91, -1, 91, 22, 70, -1, 24, 78, 25, -1, -1, 12, -1, -1, 5, 90, -1, -1, 8, 9, 75, -1, -1, 76, -1, 76, 22, 75, -1, 86, -1, 86, 10, -1, 86, 11, -1, 15, 9, 78, -1, -1, 89, -1, 89, 22, 78, -1, 52, 50, -1, 52, 55, 50, -1, 53, 50, -1, 53, 55, 50, -1, 54, 50, -1, 54, 55, 50, -1, 51, 50, -1, 50, -1, 83, -1, 80, 22, 83, -1, 80, 79, 83, -1, 80, 79, 83, 7, 90, -1, 26, -1, 81, -1, 66, -1, 24, 82, 25, -1, 26, 24, 78, 25, -1, 26, 24, 25, -1, 82, -1, 82, 6, 26, -1, 82, 26, -1, 81, -1, 81, 6, 26, -1, 81, 26, -1, 26, -1, 26, 21, 85, -1, 26, 21, 45, -1, 85, -1, 45, -1, 23, -1, 47, -1, 63, -1, 43, -1, 44, -1, 45, -1, 46, -1, 86, -1, 88, 87, 88, -1, 66, -1, 24, 88, 25, -1, 26, 24, 78, 25, -1, 26, 24, 25, -1, 88, -1, 88, 6, 26, -1, 88, 6, 48, -1, 88, 94, -1, 88, 94, 6, 26, -1, 93, -1, 40, 90, -1, 90, 42, 90, -1, 90, 41, 90, -1, 24, 90, 25, -1, 89, 27, 89, -1, 27, -1, 28, -1, 14, -1, 29, -1, 39, -1, 30, -1, 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, 36, -1, 37, -1, 38, -1, 40, -1, 89, 92, 89, -1, 89, 13, 89, 41, 89, -1, 89, 40, 92, 89, -1, 89, 40, 13, 89, 41, 89, -1, 89, 28, 40, 89, -1, 56, 95, 57, -1, 96, -1, 96, 95, -1, 58, 27, 48, -1, 61, 27, 48, -1, 59, 27, 48, -1, 60, 27, 48, -1, 62, 27, 48, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 64, 64, 65, 66, 67, 70, 72, 76, 80, 84, 88, 89, 92, 93, 96, 97, 100, 101, 104, 105, 108, 109, 112, 113, 114, 117, 118, 121, 122, 125, 126, 127, 128, 129, 130, 131, 132, 135, 136, 137, 138, 141, 144, 145, 146, 147, 148, 151, 152, 153, 155, 156, 157, 160, 161, 162, 166, 167, 168, 169, 170, 174, 175, 176, 177, 180, 181, 182, 183, 184, 185, 188, 189, 190, 191, 192, 195, 196, 197, 198, 199, 202, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 222, 223, 224, 225, 226, 229, 232, 233, 237, 238, 239, 240, 241 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "L_SELECT", "L_FROM", "L_WHERE", "L_AS", "L_ON", "L_ORDER", "L_BY", "L_ORDER_ASC", "L_ORDER_DSC", "L_DISTINCT", "L_BETWEEN", "L_IN", "L_GROUP", "L_INSERT", "L_INTO", "L_VALUES", "L_UPDATE", "L_SET", "L_DOT", "L_COMMA", "L_NULL", "L_LBRACKET", "L_RBRACKET", "L_IDENT", "L_EQ", "L_IS", "L_LIKE", "L_GT", "L_LT", "L_GEQ", "L_LEQ", "L_DIFF", "L_REGEXP", "L_REGEXP_CI", "L_NOTREGEXP", "L_NOTREGEXP_CI", "L_SIMILAR", "L_NOT", "L_AND", "L_OR", "L_MINUS", "L_PLUS", "L_TIMES", "L_DIV", "L_STRING", "L_TEXTUAL", "L_DELETE", "L_JOIN", "L_INNER", "L_LEFT", "L_RIGHT", "L_FULL", "L_OUTER", "L_LSBRACKET", "L_RSBRACKET", "L_PNAME", "L_PTYPE", "L_PISPARAM", "L_PDESCR", "L_PNULLOK", "L_UNSPECVAL", "$accept", "statement", "select_statement", "insert_statement", "update_statement", "delete_statement", "set_list", "opt_fields_list", "opt_distinct", "opt_where", "opt_orderby", "order_fields_list", "order_field", "opt_groupby", "fields_list", "join_type", "targets_list", "simple_table", "table", "target", "simple_target", "dotted_name", "field_name", "field_op", "field_raw", "field", "where_list", "set_item", "condition_operator", "where_item", "param_spec", "param_spec_list", "param_spec_item", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 64, 65, 65, 65, 65, 66, 66, 67, 68, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 81, 82, 82, 82, 82, 82, 83, 83, 83, 84, 84, 84, 85, 85, 85, 86, 86, 86, 86, 86, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 94, 95, 95, 96, 96, 96, 96, 96 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 1, 1, 1, 8, 6, 8, 5, 4, 1, 3, 3, 0, 1, 0, 2, 0, 3, 0, 1, 3, 1, 2, 2, 3, 0, 1, 3, 2, 3, 2, 3, 2, 3, 2, 1, 1, 3, 3, 5, 1, 1, 1, 3, 4, 3, 1, 3, 2, 1, 3, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 4, 3, 1, 3, 3, 2, 4, 1, 2, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, 6, 4, 3, 1, 2, 3, 3, 3, 3, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 0, 16, 0, 0, 0, 0, 2, 3, 4, 5, 15, 0, 0, 42, 51, 0, 0, 1, 59, 0, 54, 58, 60, 61, 68, 18, 57, 66, 72, 28, 14, 0, 53, 0, 18, 0, 0, 0, 0, 0, 20, 0, 62, 63, 64, 65, 0, 0, 75, 0, 0, 0, 52, 18, 0, 11, 10, 69, 54, 56, 55, 71, 0, 0, 42, 44, 18, 43, 48, 38, 0, 0, 0, 17, 77, 0, 27, 73, 74, 0, 0, 0, 0, 0, 0, 104, 67, 0, 29, 0, 0, 9, 0, 0, 70, 0, 0, 0, 37, 0, 0, 0, 0, 20, 0, 0, 50, 72, 0, 78, 0, 85, 83, 84, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 87, 97, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 103, 105, 76, 13, 0, 82, 12, 45, 47, 0, 39, 36, 30, 0, 32, 0, 34, 0, 27, 40, 49, 81, 0, 0, 0, 84, 97, 0, 98, 80, 79, 19, 21, 23, 0, 106, 108, 109, 107, 110, 0, 46, 31, 33, 35, 6, 0, 0, 102, 0, 100, 0, 24, 25, 26, 8, 41, 99, 0, 22, 101 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short int yydefgoto[] = { -1, 5, 24, 7, 8, 9, 53, 51, 11, 40, 76, 168, 169, 131, 25, 104, 66, 67, 68, 69, 15, 26, 27, 47, 28, 29, 73, 55, 126, 74, 48, 84, 85 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -126 static const short int yypact[] = { 9, 15, 1, 41, 31, 83, -126, -126, -126, -126, -126, 78, 41, -126, 46, 69, 41, -126, -126, 78, 128, -126, -126, -126, -126, 40, -126, -126, 70, 63, 81, 98, -126, 78, 86, 53, 58, 6, 16, 10, 122, -25, -126, -126, -126, -126, 84, 78, 141, 78, 78, 130, -126, 86, 126, 133, -126, -126, 144, -126, -126, -126, 142, 16, 145, -126, 107, -126, 48, -126, 10, 10, 150, 77, -126, 157, 153, -126, -126, 143, 146, 147, 148, 149, 114, 84, 94, 167, -126, 169, 171, -126, 78, 78, -126, 172, 23, 16, -126, 151, 25, 32, 67, 122, 16, 170, -126, 65, -20, -126, 78, -126, -126, 158, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, 178, 78, 10, 10, 109, 190, -126, 152, 154, 155, 156, 173, -126, -126, -126, -126, 78, -126, -126, -126, -126, 194, -126, -126, -126, 174, -126, 175, -126, 176, 153, 213, -126, -126, 181, 78, 78, -126, -126, 78, -126, -126, 182, -126, 205, 123, 78, -126, -126, -126, -126, -126, 203, -126, -126, -126, -126, -126, 10, 78, -126, 188, -126, 109, -126, -126, -126, -126, 77, -126, 78, -126, -126 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { -126, -126, 3, -126, -126, -126, 137, -126, -126, -10, 129, 43, -126, 79, -35, -126, -126, 76, 177, -87, 4, 197, -125, -126, -8, -33, -63, -126, 110, -126, -126, 159, -126 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 54, 77, 62, 6, 170, 158, 72, 108, 109, 1, 147, 35, 1, 1, 88, 89, 30, 156, 12, 1, 34, 127, 128, 78, 56, 2, 1, 10, 3, 18, 19, 61, 20, 18, 70, 16, 20, 72, 72, 86, 63, 65, 64, 91, 38, 39, 18, 19, 145, 20, 71, 21, 31, 22, 105, 21, 103, 22, 4, 142, 54, 146, 107, 170, 166, 167, 65, 13, 21, 23, 22, 41, 32, 23, 106, 149, 41, 159, 57, 14, 150, 1, 151, 17, 58, 49, 23, 152, 14, 33, 57, 39, 14, 165, 72, 72, 42, 43, 44, 45, 65, 18, 19, 59, 20, 50, 177, 65, 42, 43, 44, 45, 39, 42, 43, 44, 45, 153, 127, 128, 193, 46, 154, 21, 52, 22, 46, 185, 186, 97, 75, 187, 18, 189, 190, 58, 191, 42, 43, 44, 45, 23, 79, 80, 81, 82, 83, 87, 90, 36, 72, 194, 37, 92, 21, 93, 22, 98, 99, 100, 101, 102, 197, 110, 111, 36, 129, 94, 130, 96, 132, 137, 23, 133, 134, 135, 136, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 161, 111, 139, 140, 141, 157, 144, 160, 171, 172, 148, 173, 174, 175, 112, 162, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 163, 178, 183, 176, 184, 127, 179, 180, 181, 188, 192, 195, 143, 196, 155, 60, 182, 164, 0, 0, 0, 0, 95, 0, 0, 0, 138 }; static const short int yycheck[] = { 33, 26, 37, 0, 129, 25, 39, 70, 71, 3, 97, 19, 3, 3, 49, 50, 12, 104, 17, 3, 16, 41, 42, 48, 34, 16, 3, 12, 19, 23, 24, 25, 26, 23, 24, 4, 26, 70, 71, 47, 24, 38, 26, 53, 4, 5, 23, 24, 25, 26, 40, 45, 6, 47, 6, 45, 66, 47, 49, 92, 93, 96, 70, 188, 127, 128, 63, 26, 45, 63, 47, 6, 26, 63, 26, 50, 6, 110, 25, 3, 55, 3, 50, 0, 26, 22, 63, 55, 12, 20, 25, 5, 16, 126, 127, 128, 43, 44, 45, 46, 97, 23, 24, 45, 26, 24, 141, 104, 43, 44, 45, 46, 5, 43, 44, 45, 46, 50, 41, 42, 183, 56, 55, 45, 26, 47, 56, 160, 161, 22, 8, 164, 23, 10, 11, 26, 171, 43, 44, 45, 46, 63, 58, 59, 60, 61, 62, 6, 18, 21, 183, 184, 24, 27, 45, 22, 47, 50, 51, 52, 53, 54, 195, 13, 14, 21, 9, 25, 15, 24, 27, 57, 63, 27, 27, 27, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 13, 14, 26, 25, 24, 26, 25, 40, 9, 48, 50, 48, 48, 48, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 25, 7, 48, 41, 41, 50, 50, 50, 22, 25, 41, 93, 188, 103, 36, 155, 125, -1, -1, -1, -1, 63, -1, -1, -1, 85 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 3, 16, 19, 49, 65, 66, 67, 68, 69, 12, 72, 17, 26, 81, 84, 4, 0, 23, 24, 26, 45, 47, 63, 66, 78, 85, 86, 88, 89, 84, 6, 26, 20, 84, 88, 21, 24, 4, 5, 73, 6, 43, 44, 45, 46, 56, 87, 94, 22, 24, 71, 26, 70, 89, 91, 73, 25, 26, 45, 85, 25, 78, 24, 26, 66, 80, 81, 82, 83, 24, 40, 89, 90, 93, 8, 74, 26, 48, 58, 59, 60, 61, 62, 95, 96, 88, 6, 78, 78, 18, 73, 27, 22, 25, 82, 24, 22, 50, 51, 52, 53, 54, 73, 79, 6, 26, 88, 90, 90, 13, 14, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 92, 41, 42, 9, 15, 77, 27, 27, 27, 27, 27, 57, 95, 26, 25, 24, 89, 70, 25, 25, 78, 83, 50, 50, 55, 50, 55, 50, 55, 74, 83, 26, 25, 89, 40, 13, 28, 40, 92, 89, 90, 90, 75, 76, 86, 9, 48, 48, 48, 48, 48, 78, 25, 50, 50, 50, 77, 7, 41, 89, 89, 89, 22, 10, 11, 78, 25, 90, 89, 41, 75, 89 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (0) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) short int *bottom; short int *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short int yyssa[YYINITDEPTH]; short int *yyss = yyssa; register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; yyvsp[0] = yylval; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 64 "../libsql/parser.y" {sql_result = sql_statement_build (SQL_select, (yyvsp[0].v));} break; case 3: #line 65 "../libsql/parser.y" {sql_result = sql_statement_build (SQL_insert, (yyvsp[0].v));} break; case 4: #line 66 "../libsql/parser.y" {sql_result = sql_statement_build (SQL_update, (yyvsp[0].v));} break; case 5: #line 67 "../libsql/parser.y" {sql_result = sql_statement_build (SQL_delete, (yyvsp[0].v));} break; case 6: #line 71 "../libsql/parser.y" {(yyval.v) = sql_select_statement_build ((yyvsp[-6].i), (yyvsp[-5].list), (yyvsp[-3].list), (yyvsp[-2].w), (yyvsp[-1].list), (yyvsp[0].list));} break; case 7: #line 73 "../libsql/parser.y" {(yyval.v) = sql_select_statement_build ((yyvsp[-4].i), (yyvsp[-3].list), NULL, (yyvsp[-2].w), (yyvsp[-1].list), (yyvsp[0].list));} break; case 8: #line 77 "../libsql/parser.y" {(yyval.v) = sql_insert_statement_build ((yyvsp[-5].t), (yyvsp[-4].list), (yyvsp[-1].list));} break; case 9: #line 81 "../libsql/parser.y" {(yyval.v) = sql_update_statement_build ((yyvsp[-3].t), (yyvsp[-1].list), (yyvsp[0].w));} break; case 10: #line 85 "../libsql/parser.y" {(yyval.v) = sql_delete_statement_build ((yyvsp[-1].t), (yyvsp[0].w));} break; case 11: #line 88 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].c));} break; case 12: #line 89 "../libsql/parser.y" {(yyval.list) = g_list_prepend ((yyvsp[0].list), (yyvsp[-2].c));} break; case 13: #line 92 "../libsql/parser.y" {(yyval.list) = (yyvsp[-1].list);} break; case 14: #line 93 "../libsql/parser.y" {(yyval.list) = NULL;} break; case 15: #line 96 "../libsql/parser.y" {(yyval.i) = 1;} break; case 16: #line 97 "../libsql/parser.y" {(yyval.i) = 0;} break; case 17: #line 100 "../libsql/parser.y" {(yyval.w) = (yyvsp[0].w);} break; case 18: #line 101 "../libsql/parser.y" {(yyval.w) = NULL;} break; case 19: #line 104 "../libsql/parser.y" {(yyval.list) = (yyvsp[0].list);} break; case 20: #line 105 "../libsql/parser.y" {(yyval.list) = NULL;} break; case 21: #line 108 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].of));} break; case 22: #line 109 "../libsql/parser.y" {(yyval.list) = g_list_prepend ((yyvsp[0].list), (yyvsp[-2].of));} break; case 23: #line 112 "../libsql/parser.y" {(yyval.of) = sql_order_field_build ((yyvsp[0].list), SQL_asc);} break; case 24: #line 113 "../libsql/parser.y" {(yyval.of) = sql_order_field_build ((yyvsp[-1].list), SQL_asc);} break; case 25: #line 114 "../libsql/parser.y" {(yyval.of) = sql_order_field_build ((yyvsp[-1].list), SQL_desc);} break; case 26: #line 117 "../libsql/parser.y" {(yyval.list) = (yyvsp[0].list);} break; case 27: #line 118 "../libsql/parser.y" {(yyval.list) = NULL;} break; case 28: #line 121 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].f));} break; case 29: #line 122 "../libsql/parser.y" {(yyval.list) = g_list_prepend ((yyvsp[0].list), (yyvsp[-2].f));} break; case 30: #line 125 "../libsql/parser.y" {(yyval.i) = SQL_left_join;} break; case 31: #line 126 "../libsql/parser.y" {(yyval.i) = SQL_left_join;} break; case 32: #line 127 "../libsql/parser.y" {(yyval.i) = SQL_right_join;} break; case 33: #line 128 "../libsql/parser.y" {(yyval.i) = SQL_right_join;} break; case 34: #line 129 "../libsql/parser.y" {(yyval.i) = SQL_full_join;} break; case 35: #line 130 "../libsql/parser.y" {(yyval.i) = SQL_full_join;} break; case 36: #line 131 "../libsql/parser.y" {(yyval.i) = SQL_inner_join;} break; case 37: #line 132 "../libsql/parser.y" {(yyval.i) = SQL_inner_join;} break; case 38: #line 135 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].t));} break; case 39: #line 136 "../libsql/parser.y" {(yyval.list) = g_list_append ((yyvsp[-2].list), (yyvsp[0].t));} break; case 40: #line 137 "../libsql/parser.y" {(yyval.list) = g_list_append ((yyvsp[-2].list), sql_table_set_join ((yyvsp[0].t), (yyvsp[-1].i), NULL));} break; case 41: #line 138 "../libsql/parser.y" {(yyval.list) = g_list_append ((yyvsp[-4].list), sql_table_set_join ((yyvsp[-2].t), (yyvsp[-3].i), (yyvsp[0].w)));} break; case 42: #line 141 "../libsql/parser.y" {(yyval.t) = sql_table_build ((yyvsp[0].str)); memsql_free ((yyvsp[0].str));} break; case 43: #line 144 "../libsql/parser.y" {(yyval.t) = (yyvsp[0].t);} break; case 44: #line 145 "../libsql/parser.y" {(yyval.t) = sql_table_build_select ((yyvsp[0].v));} break; case 45: #line 146 "../libsql/parser.y" {(yyval.t) = (yyvsp[-1].t);} break; case 46: #line 147 "../libsql/parser.y" {(yyval.t) = sql_table_build_function ((yyvsp[-3].str), (yyvsp[-1].list)); } break; case 47: #line 148 "../libsql/parser.y" {(yyval.t) = sql_table_build_function ((yyvsp[-2].str), NULL); } break; case 48: #line 151 "../libsql/parser.y" {(yyval.t) = (yyvsp[0].t);} break; case 49: #line 152 "../libsql/parser.y" {(yyval.t) = sql_table_set_as ((yyvsp[-2].t), (yyvsp[0].str));} break; case 50: #line 153 "../libsql/parser.y" {(yyval.t) = sql_table_set_as ((yyvsp[-1].t), (yyvsp[0].str));} break; case 51: #line 155 "../libsql/parser.y" {(yyval.t) = (yyvsp[0].t);} break; case 52: #line 156 "../libsql/parser.y" {(yyval.t) = sql_table_set_as ((yyvsp[-2].t), (yyvsp[0].str));} break; case 53: #line 157 "../libsql/parser.y" {(yyval.t) = sql_table_set_as ((yyvsp[-1].t), (yyvsp[0].str));} break; case 54: #line 160 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, memsql_strdup ((yyvsp[0].str))); memsql_free ((yyvsp[0].str));} break; case 55: #line 161 "../libsql/parser.y" {(yyval.list) = g_list_prepend ((yyvsp[0].list), memsql_strdup ((yyvsp[-2].str))); memsql_free ((yyvsp[-2].str));} break; case 56: #line 162 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, memsql_strdup ((yyvsp[-2].str))); memsql_free ((yyvsp[-2].str)); (yyval.list) = g_list_append ((yyval.list), memsql_strdup ("*"));} break; case 57: #line 166 "../libsql/parser.y" {(yyval.list) = (yyvsp[0].list);} break; case 58: #line 167 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, memsql_strdup ("*"));} break; case 59: #line 168 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, memsql_strdup ("null"));} break; case 60: #line 169 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].str));} break; case 61: #line 170 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, memsql_strdup (""));} break; case 62: #line 174 "../libsql/parser.y" {(yyval.i) = SQL_minus;} break; case 63: #line 175 "../libsql/parser.y" {(yyval.i) = SQL_plus;} break; case 64: #line 176 "../libsql/parser.y" {(yyval.i) = SQL_times;} break; case 65: #line 177 "../libsql/parser.y" {(yyval.i) = SQL_div;} break; case 66: #line 180 "../libsql/parser.y" {(yyval.fi) = sql_field_item_build ((yyvsp[0].list));} break; case 67: #line 181 "../libsql/parser.y" {(yyval.fi) = sql_field_item_build_equation ((yyvsp[-2].fi), (yyvsp[0].fi), (yyvsp[-1].i));} break; case 68: #line 182 "../libsql/parser.y" {(yyval.fi) = sql_field_item_build_select ((yyvsp[0].v));} break; case 69: #line 183 "../libsql/parser.y" {(yyval.fi) = (yyvsp[-1].fi);} break; case 70: #line 184 "../libsql/parser.y" {(yyval.fi) = sql_field_build_function((yyvsp[-3].str), (yyvsp[-1].list)); } break; case 71: #line 185 "../libsql/parser.y" {(yyval.fi) = sql_field_build_function((yyvsp[-2].str), NULL); } break; case 72: #line 188 "../libsql/parser.y" {(yyval.f) = sql_field_build ((yyvsp[0].fi));} break; case 73: #line 189 "../libsql/parser.y" {(yyval.f) = sql_field_set_as (sql_field_build ((yyvsp[-2].fi)), (yyvsp[0].str));} break; case 74: #line 190 "../libsql/parser.y" {(yyval.f) = sql_field_set_as (sql_field_build ((yyvsp[-2].fi)), (yyvsp[0].str));} break; case 75: #line 191 "../libsql/parser.y" {(yyval.f) = sql_field_set_param_spec (sql_field_build ((yyvsp[-1].fi)), (yyvsp[0].list));} break; case 76: #line 192 "../libsql/parser.y" {(yyval.f) = sql_field_set_as (sql_field_set_param_spec (sql_field_build ((yyvsp[-3].fi)), (yyvsp[-2].list)), (yyvsp[0].str));} break; case 77: #line 195 "../libsql/parser.y" {(yyval.w) = sql_where_build_single ((yyvsp[0].c));} break; case 78: #line 196 "../libsql/parser.y" {(yyval.w) = sql_where_build_negated ((yyvsp[0].w));} break; case 79: #line 197 "../libsql/parser.y" {(yyval.w) = sql_where_build_pair ((yyvsp[-2].w), (yyvsp[0].w), SQL_or);} break; case 80: #line 198 "../libsql/parser.y" {(yyval.w) = sql_where_build_pair ((yyvsp[-2].w), (yyvsp[0].w), SQL_and);} break; case 81: #line 199 "../libsql/parser.y" {(yyval.w) = (yyvsp[-1].w);} break; case 82: #line 202 "../libsql/parser.y" {(yyval.c) = sql_build_condition ((yyvsp[-2].f), (yyvsp[0].f), SQL_eq);} break; case 83: #line 205 "../libsql/parser.y" {(yyval.i) = SQL_eq;} break; case 84: #line 206 "../libsql/parser.y" {(yyval.i) = SQL_is;} break; case 85: #line 207 "../libsql/parser.y" {(yyval.i) = SQL_in;} break; case 86: #line 208 "../libsql/parser.y" {(yyval.i) = SQL_like;} break; case 87: #line 209 "../libsql/parser.y" {(yyval.i) = SQL_similar;} break; case 88: #line 210 "../libsql/parser.y" {(yyval.i) = SQL_gt;} break; case 89: #line 211 "../libsql/parser.y" {(yyval.i) = SQL_lt;} break; case 90: #line 212 "../libsql/parser.y" {(yyval.i) = SQL_geq;} break; case 91: #line 213 "../libsql/parser.y" {(yyval.i) = SQL_leq;} break; case 92: #line 214 "../libsql/parser.y" {(yyval.i) = SQL_diff;} break; case 93: #line 215 "../libsql/parser.y" {(yyval.i) = SQL_regexp;} break; case 94: #line 216 "../libsql/parser.y" {(yyval.i) = SQL_regexp_ci;} break; case 95: #line 217 "../libsql/parser.y" {(yyval.i) = SQL_not_regexp;} break; case 96: #line 218 "../libsql/parser.y" {(yyval.i) = SQL_not_regexp_ci;} break; case 97: #line 219 "../libsql/parser.y" {(yyval.i) = SQL_not;} break; case 98: #line 222 "../libsql/parser.y" {(yyval.c) = sql_build_condition ((yyvsp[-2].f), (yyvsp[0].f), (yyvsp[-1].i));} break; case 99: #line 223 "../libsql/parser.y" {(yyval.c) = sql_build_condition_between ((yyvsp[-4].f), (yyvsp[-2].f), (yyvsp[0].f));} break; case 100: #line 224 "../libsql/parser.y" {(yyval.c) = sql_condition_negate (sql_build_condition ((yyvsp[-3].f), (yyvsp[0].f), (yyvsp[-1].i)));} break; case 101: #line 225 "../libsql/parser.y" {(yyval.c) = sql_condition_negate (sql_build_condition_between ((yyvsp[-5].f), (yyvsp[-2].f), (yyvsp[0].f)));} break; case 102: #line 226 "../libsql/parser.y" {(yyval.c) = sql_condition_negate (sql_build_condition ((yyvsp[-3].f), (yyvsp[0].f), SQL_is));} break; case 103: #line 229 "../libsql/parser.y" {(yyval.list) = (yyvsp[-1].list);} break; case 104: #line 232 "../libsql/parser.y" {(yyval.list) = g_list_append (NULL, (yyvsp[0].ps));} break; case 105: #line 233 "../libsql/parser.y" {(yyval.list) = g_list_prepend ((yyvsp[0].list), (yyvsp[-1].ps));} break; case 106: #line 237 "../libsql/parser.y" {(yyval.ps) = param_spec_build (PARAM_name, (yyvsp[0].str));} break; case 107: #line 238 "../libsql/parser.y" {(yyval.ps) = param_spec_build (PARAM_descr, (yyvsp[0].str));} break; case 108: #line 239 "../libsql/parser.y" {(yyval.ps) = param_spec_build (PARAM_type, (yyvsp[0].str));} break; case 109: #line 240 "../libsql/parser.y" {(yyval.ps) = param_spec_build (PARAM_isparam, (yyvsp[0].str));} break; case 110: #line 241 "../libsql/parser.y" {(yyval.ps) = param_spec_build (PARAM_nullok, (yyvsp[0].str));} break; } /* Line 1037 of yacc.c. */ #line 1910 "parser.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[*yyssp], yyvsp); } } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yydestruct ("Error: discarding lookahead", yytoken, &yylval); yychar = YYEMPTY; yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 243 "../libsql/parser.y"