/* A Bison parser, made by GNU Bison 1.875a. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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 /* If NAME_PREFIX is specified substitute the variables and functions 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_NOT = 290, L_AND = 291, L_OR = 292, L_MINUS = 293, L_PLUS = 294, L_TIMES = 295, L_DIV = 296, L_STRING = 297, L_TEXTUAL = 298, L_DELETE = 299, L_JOIN = 300, L_INNER = 301, L_LEFT = 302, L_RIGHT = 303, L_FULL = 304, L_OUTER = 305, L_LSBRACKET = 306, L_RSBRACKET = 307, L_PNAME = 308, L_PTYPE = 309, L_PISPARAM = 310, L_PDESCR = 311, L_PNULLOK = 312 }; #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_NOT 290 #define L_AND 291 #define L_OR 292 #define L_MINUS 293 #define L_PLUS 294 #define L_TIMES 295 #define L_DIV 296 #define L_STRING 297 #define L_TEXTUAL 298 #define L_DELETE 299 #define L_JOIN 300 #define L_INNER 301 #define L_LEFT 302 #define L_RIGHT 303 #define L_FULL 304 #define L_OUTER 305 #define L_LSBRACKET 306 #define L_RSBRACKET 307 #define L_PNAME 308 #define L_PTYPE 309 #define L_PISPARAM 310 #define L_PDESCR 311 #define L_PNULLOK 312 /* Copy the first part of user declarations. */ #line 1 "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 "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 191 of yacc.c. */ #line 229 "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 214 of yacc.c. */ #line 241 "parser.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # 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 malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short 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) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 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 yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 18 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 206 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 58 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 30 /* YYNRULES -- Number of rules. */ #define YYNRULES 95 /* YYNRULES -- Number of states. */ #define YYNSTATES 173 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 312 #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 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short 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, 143, 146, 148, 152, 154, 158, 162, 165, 170, 172, 176, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 202, 204, 208, 213, 217, 219, 222, 226, 230, 234, 238, 240, 242, 245, 247, 250, 252, 254, 256, 258, 260, 262, 266, 272, 276, 278, 281, 285, 289, 293, 297 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 59, 0, -1, 60, -1, 61, -1, 62, -1, 63, -1, 3, 66, 72, 4, 74, 67, 68, 71, -1, 3, 66, 72, 67, 68, 71, -1, 16, 17, 75, 65, 18, 24, 72, 25, -1, 19, 75, 20, 64, 67, -1, 44, 4, 75, 67, -1, 82, -1, 82, 22, 64, -1, 24, 72, 25, -1, -1, 12, -1, -1, 5, 81, -1, -1, 8, 9, 69, -1, -1, 70, -1, 70, 22, 69, -1, 78, -1, 78, 10, -1, 78, 11, -1, 15, 9, 72, -1, -1, 76, -1, 76, 22, 72, -1, 47, 45, -1, 47, 50, 45, -1, 48, 45, -1, 48, 50, 45, -1, 49, 45, -1, 49, 50, 45, -1, 46, 45, -1, 45, -1, 75, -1, 74, 22, 75, -1, 74, 73, 75, -1, 74, 73, 75, 7, 81, -1, 26, -1, 75, 6, 26, -1, 75, 26, -1, 60, -1, 24, 75, 25, -1, 80, -1, 80, 6, 26, -1, 80, 6, 43, -1, 80, 85, -1, 80, 85, 6, 26, -1, 26, -1, 26, 21, 77, -1, 26, 21, 40, -1, 77, -1, 40, -1, 23, -1, 42, -1, 38, -1, 39, -1, 40, -1, 41, -1, 78, -1, 80, 79, 80, -1, 60, -1, 24, 80, 25, -1, 26, 24, 72, 25, -1, 26, 24, 25, -1, 84, -1, 35, 81, -1, 81, 37, 81, -1, 81, 36, 81, -1, 24, 81, 25, -1, 76, 27, 76, -1, 27, -1, 28, -1, 28, 35, -1, 14, -1, 35, 14, -1, 29, -1, 30, -1, 31, -1, 32, -1, 33, -1, 34, -1, 76, 83, 76, -1, 76, 13, 76, 36, 76, -1, 51, 86, 52, -1, 87, -1, 87, 86, -1, 53, 27, 43, -1, 56, 27, 43, -1, 54, 27, 43, -1, 55, 27, 43, -1, 57, 27, 43, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 63, 63, 64, 65, 66, 69, 71, 75, 79, 83, 87, 88, 91, 92, 95, 96, 99, 100, 103, 104, 107, 108, 111, 112, 113, 116, 117, 120, 121, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 137, 140, 141, 142, 143, 144, 147, 148, 149, 150, 151, 154, 155, 156, 160, 161, 162, 163, 167, 168, 169, 170, 173, 174, 175, 176, 177, 178, 181, 182, 183, 184, 185, 188, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 204, 205, 208, 211, 212, 216, 217, 218, 219, 220 }; #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_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", "$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", "tables_list", "table", "field", "dotted_name", "field_name", "field_op", "field_raw", "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 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 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 58, 59, 59, 59, 59, 60, 60, 61, 62, 63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 77, 77, 77, 78, 78, 78, 78, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 85, 86, 86, 87, 87, 87, 87, 87 }; /* 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, 3, 2, 1, 3, 1, 3, 3, 2, 4, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 4, 3, 1, 2, 3, 3, 3, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 3, 5, 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, 0, 42, 45, 0, 0, 1, 57, 0, 52, 56, 58, 65, 18, 28, 55, 63, 47, 14, 0, 0, 0, 44, 18, 0, 0, 0, 0, 0, 20, 0, 0, 59, 60, 61, 62, 0, 0, 50, 0, 0, 46, 43, 18, 0, 11, 10, 66, 52, 54, 53, 68, 0, 18, 38, 0, 0, 0, 17, 69, 0, 27, 29, 48, 49, 0, 0, 0, 0, 0, 0, 89, 64, 0, 0, 0, 9, 0, 0, 67, 0, 37, 0, 0, 0, 0, 20, 0, 47, 0, 70, 0, 78, 75, 76, 80, 81, 82, 83, 84, 85, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 88, 90, 51, 13, 0, 74, 12, 39, 36, 30, 0, 32, 0, 34, 0, 27, 40, 73, 0, 77, 79, 86, 72, 71, 19, 21, 23, 0, 91, 93, 94, 92, 95, 0, 31, 33, 35, 6, 0, 0, 0, 24, 25, 26, 8, 41, 87, 22 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { -1, 5, 24, 7, 8, 9, 55, 52, 11, 41, 73, 149, 150, 119, 25, 99, 65, 16, 26, 27, 28, 49, 29, 70, 57, 114, 71, 50, 82, 83 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -116 static const short yypact[] = { 10, 0, 29, 45, 76, 90, -116, -116, -116, -116, -116, 102, 45, 45, -116, -116, 68, 45, -116, -116, 102, 6, -116, -116, -116, 4, 27, -116, -116, 26, 13, 15, 50, 102, -116, 19, 109, 49, 93, 45, 97, 85, 102, 12, -116, -116, -116, -116, 113, 102, 101, 102, 81, -116, -116, 119, 111, 107, -116, -116, 122, -116, -116, -116, 120, 63, 46, 97, 97, 127, 115, -116, 137, 121, -116, -116, -116, 136, 148, 149, 150, 151, 129, 113, 133, 153, 155, 158, -116, 102, 102, -116, 45, -116, 138, -14, 41, 77, 85, 45, 22, 128, -116, 102, -116, -116, 152, -116, -116, -116, -116, -116, -116, 170, 102, 97, 97, 61, 176, -116, 143, 145, 146, 147, 154, -116, -116, -116, -116, 102, -116, -116, 46, -116, -116, 156, -116, 157, -116, 159, 121, 72, -116, 160, -116, -116, -116, -116, 162, -116, 169, 103, 102, -116, -116, -116, -116, -116, 167, -116, -116, -116, -116, 97, 102, 61, -116, -116, -116, -116, 115, -116, -116 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { -116, -116, 3, -116, -116, -116, 104, -116, -116, -12, 95, 30, -116, 59, -37, -116, -116, 5, -33, 163, -115, -116, -16, -57, -116, -116, -116, -116, 123, -116 }; /* 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[] = { 56, 64, 151, 6, 36, 74, 15, 69, 39, 40, 101, 102, 10, 1, 86, 15, 15, 30, 31, 32, 15, 32, 35, 58, 40, 32, 2, 37, 43, 3, 38, 134, 43, 84, 69, 69, 135, 51, 75, 34, 53, 34, 15, 88, 66, 34, 12, 59, 1, 42, 151, 100, 32, 98, 4, 76, 130, 56, 147, 148, 44, 45, 46, 47, 44, 45, 46, 47, 40, 13, 143, 14, 34, 48, 32, 60, 54, 48, 32, 163, 17, 146, 69, 69, 19, 92, 136, 60, 33, 61, 18, 137, 158, 72, 34, 15, 1, 132, 34, 87, 1, 22, 15, 23, 141, 1, 170, 85, 93, 94, 95, 96, 97, 166, 167, 168, 19, 20, 63, 21, 19, 67, 138, 21, 40, 19, 20, 139, 21, 90, 69, 171, 68, 22, 59, 23, 118, 22, 89, 23, 103, 104, 22, 37, 23, 91, 117, 44, 45, 46, 47, 115, 116, 142, 105, 106, 107, 108, 109, 110, 111, 112, 113, 120, 115, 116, 77, 78, 79, 80, 81, 44, 45, 46, 47, 121, 122, 123, 124, 127, 128, 125, 129, 133, 145, 152, 153, 144, 154, 155, 156, 165, 169, 140, 131, 172, 164, 157, 115, 162, 62, 159, 160, 0, 161, 0, 126 }; static const short yycheck[] = { 33, 38, 117, 0, 20, 42, 3, 40, 4, 5, 67, 68, 12, 3, 51, 12, 13, 12, 13, 6, 17, 6, 17, 35, 5, 6, 16, 21, 6, 19, 24, 45, 6, 49, 67, 68, 50, 24, 26, 26, 25, 26, 39, 55, 39, 26, 17, 25, 3, 22, 165, 67, 6, 65, 44, 43, 89, 90, 115, 116, 38, 39, 40, 41, 38, 39, 40, 41, 5, 24, 103, 26, 26, 51, 6, 26, 26, 51, 6, 7, 4, 114, 115, 116, 23, 22, 45, 26, 20, 40, 0, 50, 129, 8, 26, 92, 3, 92, 26, 18, 3, 40, 99, 42, 99, 3, 163, 6, 45, 46, 47, 48, 49, 10, 11, 152, 23, 24, 25, 26, 23, 24, 45, 26, 5, 23, 24, 50, 26, 22, 163, 164, 35, 40, 25, 42, 15, 40, 27, 42, 13, 14, 40, 21, 42, 25, 9, 38, 39, 40, 41, 36, 37, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 27, 36, 37, 53, 54, 55, 56, 57, 38, 39, 40, 41, 27, 27, 27, 27, 26, 25, 52, 24, 45, 14, 9, 43, 35, 43, 43, 43, 22, 25, 98, 90, 165, 36, 43, 36, 140, 37, 45, 45, -1, 45, -1, 83 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 3, 16, 19, 44, 59, 60, 61, 62, 63, 12, 66, 17, 24, 26, 60, 75, 4, 0, 23, 24, 26, 40, 42, 60, 72, 76, 77, 78, 80, 75, 75, 6, 20, 26, 75, 80, 21, 24, 4, 5, 67, 22, 6, 38, 39, 40, 41, 51, 79, 85, 24, 65, 25, 26, 64, 76, 82, 67, 25, 26, 40, 77, 25, 72, 74, 75, 24, 35, 76, 81, 84, 8, 68, 72, 26, 43, 53, 54, 55, 56, 57, 86, 87, 80, 6, 72, 18, 67, 27, 22, 25, 22, 45, 46, 47, 48, 49, 67, 73, 80, 81, 81, 13, 14, 27, 28, 29, 30, 31, 32, 33, 34, 35, 83, 36, 37, 9, 15, 71, 27, 27, 27, 27, 27, 52, 86, 26, 25, 24, 76, 64, 75, 45, 45, 50, 45, 50, 45, 50, 68, 75, 25, 76, 35, 14, 76, 81, 81, 69, 70, 78, 9, 43, 43, 43, 43, 43, 72, 45, 45, 45, 71, 7, 36, 22, 10, 11, 72, 25, 81, 76, 69 }; #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 yyerrlab1 /* 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 -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #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 YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *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 yylineno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* 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 YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, 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. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #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]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; 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 lookahead symbol. */ int yychar; /* The semantic value of the lookahead 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; /* Lookahead 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 yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *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; 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 *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 *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 lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead 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); YYDSYMPRINTF ("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 lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* 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 63 "parser.y" {sql_result = sql_statement_build (SQL_select, yyvsp[0].v);} break; case 3: #line 64 "parser.y" {sql_result = sql_statement_build (SQL_insert, yyvsp[0].v);} break; case 4: #line 65 "parser.y" {sql_result = sql_statement_build (SQL_update, yyvsp[0].v);} break; case 5: #line 66 "parser.y" {sql_result = sql_statement_build (SQL_delete, yyvsp[0].v);} break; case 6: #line 70 "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 72 "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 76 "parser.y" {yyval.v = sql_insert_statement_build (yyvsp[-5].t, yyvsp[-4].list, yyvsp[-1].list);} break; case 9: #line 80 "parser.y" {yyval.v = sql_update_statement_build (yyvsp[-3].t, yyvsp[-1].list, yyvsp[0].w);} break; case 10: #line 84 "parser.y" {yyval.v = sql_delete_statement_build (yyvsp[-1].t, yyvsp[0].w);} break; case 11: #line 87 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].c);} break; case 12: #line 88 "parser.y" {yyval.list = g_list_prepend (yyvsp[0].list, yyvsp[-2].c);} break; case 13: #line 91 "parser.y" {yyval.list = yyvsp[-1].list;} break; case 14: #line 92 "parser.y" {yyval.list = NULL;} break; case 15: #line 95 "parser.y" {yyval.i = 1;} break; case 16: #line 96 "parser.y" {yyval.i = 0;} break; case 17: #line 99 "parser.y" {yyval.w = yyvsp[0].w;} break; case 18: #line 100 "parser.y" {yyval.w = NULL;} break; case 19: #line 103 "parser.y" {yyval.list = yyvsp[0].list;} break; case 20: #line 104 "parser.y" {yyval.list = NULL;} break; case 21: #line 107 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].of);} break; case 22: #line 108 "parser.y" {yyval.list = g_list_prepend (yyvsp[0].list, yyvsp[-2].of);} break; case 23: #line 111 "parser.y" {yyval.of = sql_order_field_build (yyvsp[0].list, SQL_asc);} break; case 24: #line 112 "parser.y" {yyval.of = sql_order_field_build (yyvsp[-1].list, SQL_asc);} break; case 25: #line 113 "parser.y" {yyval.of = sql_order_field_build (yyvsp[-1].list, SQL_desc);} break; case 26: #line 116 "parser.y" {yyval.list = yyvsp[0].list;} break; case 27: #line 117 "parser.y" {yyval.list = NULL;} break; case 28: #line 120 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].f);} break; case 29: #line 121 "parser.y" {yyval.list = g_list_prepend (yyvsp[0].list, yyvsp[-2].f);} break; case 30: #line 124 "parser.y" {yyval.i = SQL_left_join;} break; case 31: #line 125 "parser.y" {yyval.i = SQL_left_join;} break; case 32: #line 126 "parser.y" {yyval.i = SQL_right_join;} break; case 33: #line 127 "parser.y" {yyval.i = SQL_right_join;} break; case 34: #line 128 "parser.y" {yyval.i = SQL_full_join;} break; case 35: #line 129 "parser.y" {yyval.i = SQL_full_join;} break; case 36: #line 130 "parser.y" {yyval.i = SQL_inner_join;} break; case 37: #line 131 "parser.y" {yyval.i = SQL_inner_join;} break; case 38: #line 134 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].t);} break; case 39: #line 135 "parser.y" {yyval.list = g_list_append (yyvsp[-2].list, yyvsp[0].t);} break; case 40: #line 136 "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 137 "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 140 "parser.y" {yyval.t = sql_table_build (yyvsp[0].str); memsql_free (yyvsp[0].str);} break; case 43: #line 141 "parser.y" {yyval.t = sql_table_set_as (yyvsp[-2].t, yyvsp[0].str);} break; case 44: #line 142 "parser.y" {yyval.t = sql_table_set_as (yyvsp[-1].t, yyvsp[0].str);} break; case 45: #line 143 "parser.y" {yyval.t = sql_table_build_select (yyvsp[0].v);} break; case 46: #line 144 "parser.y" {yyval.t = yyvsp[-1].t;} break; case 47: #line 147 "parser.y" {yyval.f = sql_field_build (yyvsp[0].fi);} break; case 48: #line 148 "parser.y" {yyval.f = sql_field_set_as (sql_field_build (yyvsp[-2].fi), yyvsp[0].str);} break; case 49: #line 149 "parser.y" {yyval.f = sql_field_set_as (sql_field_build (yyvsp[-2].fi), yyvsp[0].str);} break; case 50: #line 150 "parser.y" {yyval.f = sql_field_set_param_spec (sql_field_build (yyvsp[-1].fi), yyvsp[0].list);} break; case 51: #line 151 "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 52: #line 154 "parser.y" {yyval.list = g_list_append (NULL, memsql_strdup (yyvsp[0].str)); memsql_free (yyvsp[0].str);} break; case 53: #line 155 "parser.y" {yyval.list = g_list_prepend (yyvsp[0].list, memsql_strdup (yyvsp[-2].str)); memsql_free (yyvsp[-2].str);} break; case 54: #line 156 "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 55: #line 160 "parser.y" {yyval.list = yyvsp[0].list;} break; case 56: #line 161 "parser.y" {yyval.list = g_list_append (NULL, memsql_strdup ("*"));} break; case 57: #line 162 "parser.y" {yyval.list = g_list_append (NULL, memsql_strdup ("null"));} break; case 58: #line 163 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].str);} break; case 59: #line 167 "parser.y" {yyval.i = SQL_minus;} break; case 60: #line 168 "parser.y" {yyval.i = SQL_plus;} break; case 61: #line 169 "parser.y" {yyval.i = SQL_times;} break; case 62: #line 170 "parser.y" {yyval.i = SQL_div;} break; case 63: #line 173 "parser.y" {yyval.fi = sql_field_item_build (yyvsp[0].list);} break; case 64: #line 174 "parser.y" {yyval.fi = sql_field_item_build_equation (yyvsp[-2].fi, yyvsp[0].fi, yyvsp[-1].i);} break; case 65: #line 175 "parser.y" {yyval.fi = sql_field_item_build_select (yyvsp[0].v);} break; case 66: #line 176 "parser.y" {yyval.fi = yyvsp[-1].fi;} break; case 67: #line 177 "parser.y" {yyval.fi = sql_field_build_function(yyvsp[-3].str, yyvsp[-1].list); } break; case 68: #line 178 "parser.y" {yyval.fi = sql_field_build_function(yyvsp[-2].str, NULL); } break; case 69: #line 181 "parser.y" {yyval.w = sql_where_build_single (yyvsp[0].c);} break; case 70: #line 182 "parser.y" {yyval.w = sql_where_build_negated (yyvsp[0].w);} break; case 71: #line 183 "parser.y" {yyval.w = sql_where_build_pair (yyvsp[-2].w, yyvsp[0].w, SQL_or);} break; case 72: #line 184 "parser.y" {yyval.w = sql_where_build_pair (yyvsp[-2].w, yyvsp[0].w, SQL_and);} break; case 73: #line 185 "parser.y" {yyval.w = yyvsp[-1].w;} break; case 74: #line 188 "parser.y" {yyval.c = sql_build_condition (yyvsp[-2].f, yyvsp[0].f, SQL_eq);} break; case 75: #line 191 "parser.y" {yyval.i = SQL_eq;} break; case 76: #line 192 "parser.y" {yyval.i = SQL_is;} break; case 77: #line 193 "parser.y" {yyval.i = SQL_isnot;} break; case 78: #line 194 "parser.y" {yyval.i = SQL_in;} break; case 79: #line 195 "parser.y" {yyval.i = SQL_notin;} break; case 80: #line 196 "parser.y" {yyval.i = SQL_like;} break; case 81: #line 197 "parser.y" {yyval.i = SQL_gt;} break; case 82: #line 198 "parser.y" {yyval.i = SQL_lt;} break; case 83: #line 199 "parser.y" {yyval.i = SQL_geq;} break; case 84: #line 200 "parser.y" {yyval.i = SQL_leq;} break; case 85: #line 201 "parser.y" {yyval.i = SQL_diff;} break; case 86: #line 204 "parser.y" {yyval.c = sql_build_condition (yyvsp[-2].f, yyvsp[0].f, yyvsp[-1].i);} break; case 87: #line 205 "parser.y" {yyval.c = sql_build_condition_between (yyvsp[-4].f, yyvsp[-2].f, yyvsp[0].f);} break; case 88: #line 208 "parser.y" {yyval.list = yyvsp[-1].list;} break; case 89: #line 211 "parser.y" {yyval.list = g_list_append (NULL, yyvsp[0].ps);} break; case 90: #line 212 "parser.y" {yyval.list = g_list_prepend (yyvsp[0].list, yyvsp[-1].ps);} break; case 91: #line 216 "parser.y" {yyval.ps = param_spec_build (PARAM_name, yyvsp[0].str);} break; case 92: #line 217 "parser.y" {yyval.ps = param_spec_build (PARAM_descr, yyvsp[0].str);} break; case 93: #line 218 "parser.y" {yyval.ps = param_spec_build (PARAM_type, yyvsp[0].str);} break; case 94: #line 219 "parser.y" {yyval.ps = param_spec_build (PARAM_isparam, yyvsp[0].str);} break; case 95: #line 220 "parser.y" {yyval.ps = param_spec_build (PARAM_nullok, yyvsp[0].str);} break; } /* Line 999 of yacc.c. */ #line 1760 "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); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += 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) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } 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 lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ 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; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: 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 222 "parser.y"