1 /* A Bison parser, made from ifq.y, by GNU bison 1.75. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
42 /* Using locations. */
43 #define YYLSP_NEEDED 0
45 /* If NAME_PREFIX is specified substitute the variables and functions
47 #define yyparse IfqParserparse
48 #define yylex IfqParserlex
49 #define yyerror IfqParsererror
50 #define yylval IfqParserlval
51 #define yychar IfqParserchar
52 #define yydebug IfqParserdebug
53 #define yynerrs IfqParsernerrs
59 /* Put the tokens into the symbol table, so that GDB and other debuggers
80 LEFT_OUTER_JOIN = 276,
81 RIGHT_OUTER_JOIN = 277,
107 SELECTION_PUSHDOWN = 303
112 #define STRING_TOKEN 260
114 #define LONGINTNUM 262
115 #define APPROXNUM 263
119 #define SEMICOLON 267
120 #define LEFTBRACE 268
121 #define RIGHTBRACE 269
126 #define INNER_JOIN 274
127 #define OUTER_JOIN 275
128 #define LEFT_OUTER_JOIN 276
129 #define RIGHT_OUTER_JOIN 277
139 #define TIMEVAL_L 287
145 #define DEFINE_SEC 293
146 #define PARAM_SEC 294
152 #define OPERATOR_VIEW 300
154 #define SUBQUERIES 302
155 #define SELECTION_PUSHDOWN 303
160 /* Copy the first part of user declarations. */
167 /* Some addn'l includes, necessary but not included by the
168 bison generated code.
173 /* prototypes for the parser callbacks.
176 #include "parse_fta.h"
179 extern fta_parse_t *ifq_parse_result;
186 /* Enabling traces. */
191 /* Enabling verbose error messages. */
192 #ifdef YYERROR_VERBOSE
193 # undef YYERROR_VERBOSE
194 # define YYERROR_VERBOSE 1
196 # define YYERROR_VERBOSE 0
207 /* for FTA definition. */
209 scalarexp_t *scalarval;
210 se_list_t *se_listval;
211 select_list_t *select_listval;
214 literal_list_t *lit_l;
216 tablevar_list_t *tbl_list;
218 colref_list_t *clist;
219 var_defs_t *var_defs;
220 var_pair_t *var_pair;
224 query_list_t *q_list;
228 /* Line 193 of /usr/local/share/bison/yacc.c. */
229 #line 230 "ifq.tab.cc"
230 # define YYSTYPE yystype
231 # define YYSTYPE_IS_TRIVIAL 1
235 typedef struct yyltype
242 # define YYLTYPE yyltype
243 # define YYLTYPE_IS_TRIVIAL 1
246 /* Copy the second part of user declarations. */
249 /* Line 213 of /usr/local/share/bison/yacc.c. */
250 #line 251 "ifq.tab.cc"
252 #if ! defined (yyoverflow) || YYERROR_VERBOSE
254 /* The parser invokes alloca or malloc; define the necessary symbols. */
256 # if YYSTACK_USE_ALLOCA
257 # define YYSTACK_ALLOC alloca
259 # ifndef YYSTACK_USE_ALLOCA
260 # if defined (alloca) || defined (_ALLOCA_H)
261 # define YYSTACK_ALLOC alloca
264 # define YYSTACK_ALLOC __builtin_alloca
270 # ifdef YYSTACK_ALLOC
271 /* Pacify GCC's `empty if-body' warning. */
272 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
274 # if defined (__STDC__) || defined (__cplusplus)
275 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
276 # define YYSIZE_T size_t
278 # define YYSTACK_ALLOC malloc
279 # define YYSTACK_FREE free
281 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
284 #if (! defined (yyoverflow) \
285 && (! defined (__cplusplus) \
286 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
288 /* A type that is properly aligned for any stack member. */
295 /* The size of the maximum gap between one aligned stack and the next. */
296 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
298 /* The size of an array large to enough to hold all stacks, each with
300 # define YYSTACK_BYTES(N) \
301 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
304 /* Copy COUNT objects from FROM to TO. The source and destination do
308 # define YYCOPY(To, From, Count) \
309 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
311 # define YYCOPY(To, From, Count) \
314 register YYSIZE_T yyi; \
315 for (yyi = 0; yyi < (Count); yyi++) \
316 (To)[yyi] = (From)[yyi]; \
322 /* Relocate STACK from its old location to the new one. The
323 local variables YYSIZE and YYSTACKSIZE give the old and new number of
324 elements in the stack, and YYPTR gives the new location of the
325 stack. Advance YYPTR to a properly aligned location for the next
327 # define YYSTACK_RELOCATE(Stack) \
330 YYSIZE_T yynewbytes; \
331 YYCOPY (&yyptr->Stack, Stack, yysize); \
332 Stack = &yyptr->Stack; \
333 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
334 yyptr += yynewbytes / sizeof (*yyptr); \
340 #if defined (__STDC__) || defined (__cplusplus)
341 typedef signed char yysigned_char;
343 typedef short yysigned_char;
346 /* YYFINAL -- State number of the termination state. */
350 /* YYNTOKENS -- Number of terminals. */
352 /* YYNNTS -- Number of nonterminals. */
354 /* YYNRULES -- Number of rules. */
356 /* YYNRULES -- Number of states. */
359 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
361 #define YYMAXUTOK 303
363 #define YYTRANSLATE(X) \
364 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
366 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
367 static const unsigned char yytranslate[] =
369 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 50, 51, 2, 2, 54, 2, 2, 2, 2, 2,
374 2, 2, 2, 2, 2, 2, 2, 2, 49, 2,
375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 52, 2, 53, 2, 2, 2, 2, 2, 2,
379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
395 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
396 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
397 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
398 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
403 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
405 static const unsigned char yyprhs[] =
407 0, 0, 3, 5, 9, 11, 15, 17, 19, 21,
408 25, 29, 32, 36, 38, 43, 45, 47, 49, 53,
409 55, 57, 59, 61, 63, 65, 68, 71, 74
412 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
413 static const yysigned_char yyrhs[] =
415 56, 0, -1, 58, -1, 3, 49, 59, -1, 57,
416 -1, 58, 12, 57, -1, 60, -1, 61, -1, 62,
417 -1, 62, 9, 62, -1, 62, 10, 62, -1, 11,
418 62, -1, 50, 62, 51, -1, 63, -1, 4, 52,
419 65, 53, -1, 66, -1, 3, -1, 64, -1, 65,
420 54, 64, -1, 5, -1, 6, -1, 7, -1, 8,
421 -1, 30, -1, 31, -1, 32, 5, -1, 33, 5,
422 -1, 34, 5, -1, 35, 5, -1
425 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
426 static const unsigned char yyrline[] =
428 0, 117, 117, 130, 135, 136, 140, 149, 155, 163,
429 165, 166, 167, 168, 171, 178, 180, 184, 186, 189,
430 191, 192, 193, 194, 195, 196, 197, 198, 199
434 #if YYDEBUG || YYERROR_VERBOSE
435 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
436 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
437 static const char *const yytname[] =
439 "$end", "error", "$undefined", "NAME", "PRED", "STRING_TOKEN", "INTNUM",
440 "LONGINTNUM", "APPROXNUM", "OR", "AND", "NOT", "SEMICOLON", "LEFTBRACE",
441 "RIGHTBRACE", "BY", "AS", "AGGR", "FROM", "INNER_JOIN", "OUTER_JOIN",
442 "LEFT_OUTER_JOIN", "RIGHT_OUTER_JOIN", "GROUP", "HAVING", "IN",
443 "SELECT", "WHERE", "SUCH", "THAT", "TRUE_V", "FALSE_V", "TIMEVAL_L",
444 "HEX_L", "LHEX_L", "IP_L", "MERGE", "SLACK", "DEFINE_SEC", "PARAM_SEC",
445 "PROTOCOL", "TABLE", "STREAM", "FTA", "OPERATOR", "OPERATOR_VIEW",
446 "FIELDS", "SUBQUERIES", "SELECTION_PUSHDOWN", "':'", "'('", "')'",
447 "'['", "']'", "','", "$accept", "parse_result", "gsql", "query_list",
448 "select_statement", "table_exp", "where_clause", "search_condition",
449 "predicate", "scalar_exp", "scalar_exp_commalist", "literal", 0
454 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
456 static const unsigned short yytoknum[] =
458 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
459 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
460 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
461 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
462 295, 296, 297, 298, 299, 300, 301, 302, 303, 58,
467 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
468 static const unsigned char yyr1[] =
470 0, 55, 56, 57, 58, 58, 59, 60, 61, 62,
471 62, 62, 62, 62, 63, 64, 64, 65, 65, 66,
472 66, 66, 66, 66, 66, 66, 66, 66, 66
475 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
476 static const unsigned char yyr2[] =
478 0, 2, 1, 3, 1, 3, 1, 1, 1, 3,
479 3, 2, 3, 1, 4, 1, 1, 1, 3, 1,
480 1, 1, 1, 1, 1, 2, 2, 2, 2
483 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
484 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
485 means the default is an error. */
486 static const unsigned char yydefact[] =
488 0, 0, 0, 4, 2, 0, 1, 0, 0, 0,
489 0, 3, 6, 7, 8, 13, 5, 0, 11, 0,
490 0, 0, 16, 19, 20, 21, 22, 23, 24, 0,
491 0, 0, 0, 17, 0, 15, 12, 9, 10, 25,
492 26, 27, 28, 14, 0, 18
495 /* YYDEFGOTO[NTERM-NUM]. */
496 static const yysigned_char yydefgoto[] =
498 -1, 2, 3, 4, 11, 12, 13, 14, 15, 33,
502 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
504 #define YYPACT_NINF -42
505 static const yysigned_char yypact[] =
507 2, -31, 19, -42, 8, -4, -42, 2, -30, -4,
508 -4, -42, -42, -42, 7, -42, -42, 3, -42, -8,
509 -4, -4, -42, -42, -42, -42, -42, -42, -42, 16,
510 18, 20, 21, -42, -41, -42, -42, 14, -42, -42,
511 -42, -42, -42, -42, 3, -42
514 /* YYPGOTO[NTERM-NUM]. */
515 static const yysigned_char yypgoto[] =
517 -42, -42, 22, -42, -42, -42, -42, -6, -42, -17,
521 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
522 positive, shift that token. If negative, reduce the rule which
523 number is the opposite. If zero, do what YYDEFACT says.
524 If YYTABLE_NINF, parse error. */
525 #define YYTABLE_NINF -1
526 static const unsigned char yytable[] =
528 8, 20, 21, 18, 19, 1, 22, 9, 23, 24,
529 25, 26, 43, 44, 37, 38, 20, 21, 5, 6,
530 7, 39, 17, 40, 21, 41, 42, 45, 0, 16,
531 0, 0, 0, 27, 28, 29, 30, 31, 32, 0,
532 0, 0, 0, 36, 0, 0, 10
535 static const yysigned_char yycheck[] =
537 4, 9, 10, 9, 10, 3, 3, 11, 5, 6,
538 7, 8, 53, 54, 20, 21, 9, 10, 49, 0,
539 12, 5, 52, 5, 10, 5, 5, 44, -1, 7,
540 -1, -1, -1, 30, 31, 32, 33, 34, 35, -1,
541 -1, -1, -1, 51, -1, -1, 50
544 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
545 symbol of state STATE-NUM. */
546 static const unsigned char yystos[] =
548 0, 3, 56, 57, 58, 49, 0, 12, 4, 11,
549 50, 59, 60, 61, 62, 63, 57, 52, 62, 62,
550 9, 10, 3, 5, 6, 7, 8, 30, 31, 32,
551 33, 34, 35, 64, 65, 66, 51, 62, 62, 5,
555 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
556 # define YYSIZE_T __SIZE_TYPE__
558 #if ! defined (YYSIZE_T) && defined (size_t)
559 # define YYSIZE_T size_t
561 #if ! defined (YYSIZE_T)
562 # if defined (__STDC__) || defined (__cplusplus)
563 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
564 # define YYSIZE_T size_t
567 #if ! defined (YYSIZE_T)
568 # define YYSIZE_T unsigned int
571 #define yyerrok (yyerrstatus = 0)
572 #define yyclearin (yychar = YYEMPTY)
576 #define YYACCEPT goto yyacceptlab
577 #define YYABORT goto yyabortlab
578 #define YYERROR goto yyerrlab1
580 /* Like YYERROR except do call yyerror. This remains here temporarily
581 to ease the transition to the new meaning of YYERROR, for GCC.
582 Once GCC version 2 has supplanted version 1, this can go. */
584 #define YYFAIL goto yyerrlab
586 #define YYRECOVERING() (!!yyerrstatus)
588 #define YYBACKUP(Token, Value) \
590 if (yychar == YYEMPTY && yylen == 1) \
594 yychar1 = YYTRANSLATE (yychar); \
600 yyerror ("syntax error: cannot back up"); \
606 #define YYERRCODE 256
608 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
611 #ifndef YYLLOC_DEFAULT
612 # define YYLLOC_DEFAULT(Current, Rhs, N) \
613 Current.first_line = Rhs[1].first_line; \
614 Current.first_column = Rhs[1].first_column; \
615 Current.last_line = Rhs[N].last_line; \
616 Current.last_column = Rhs[N].last_column;
619 /* YYLEX -- calling `yylex' with the right arguments. */
621 #define YYLEX yylex ()
623 /* Enable debugging if requested. */
627 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
628 # define YYFPRINTF fprintf
631 # define YYDPRINTF(Args) \
636 # define YYDSYMPRINT(Args) \
641 /* Nonzero means print parse trace. It is left uninitialized so that
642 multiple parsers can coexist. */
645 # define YYDPRINTF(Args)
646 # define YYDSYMPRINT(Args)
647 #endif /* !YYDEBUG */
649 /* YYINITDEPTH -- initial size of the parser's stacks. */
651 # define YYINITDEPTH 200
654 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
655 if the built-in stack extension method is used).
657 Do not make this value too large; the results are undefined if
658 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
659 evaluated with infinite-precision integer arithmetic. */
666 # define YYMAXDEPTH 10000
674 # if defined (__GLIBC__) && defined (_STRING_H)
675 # define yystrlen strlen
677 /* Return the length of YYSTR. */
679 # if defined (__STDC__) || defined (__cplusplus)
680 yystrlen (const char *yystr)
686 register const char *yys = yystr;
688 while (*yys++ != '\0')
691 return yys - yystr - 1;
697 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
698 # define yystpcpy stpcpy
700 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
703 # if defined (__STDC__) || defined (__cplusplus)
704 yystpcpy (char *yydest, const char *yysrc)
706 yystpcpy (yydest, yysrc)
711 register char *yyd = yydest;
712 register const char *yys = yysrc;
714 while ((*yyd++ = *yys++) != '\0')
722 #endif /* !YYERROR_VERBOSE */
727 /*-----------------------------.
728 | Print this symbol on YYOUT. |
729 `-----------------------------*/
732 #if defined (__STDC__) || defined (__cplusplus)
733 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
735 yysymprint (yyout, yytype, yyvalue)
741 /* Pacify ``unused variable'' warnings. */
744 if (yytype < YYNTOKENS)
746 YYFPRINTF (yyout, "token %s (", yytname[yytype]);
748 YYPRINT (yyout, yytoknum[yytype], yyvalue);
752 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
759 YYFPRINTF (yyout, ")");
761 #endif /* YYDEBUG. */
764 /*-----------------------------------------------.
765 | Release the memory associated to this symbol. |
766 `-----------------------------------------------*/
769 #if defined (__STDC__) || defined (__cplusplus)
770 yydestruct (int yytype, YYSTYPE yyvalue)
772 yydestruct (yytype, yyvalue)
777 /* Pacify ``unused variable'' warnings. */
789 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
790 into yyparse. The argument should have type void *.
791 It should actually point to an object.
792 Grammar actions can access the variable by casting it
793 to the proper pointer type. */
796 # if defined (__STDC__) || defined (__cplusplus)
797 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
798 # define YYPARSE_PARAM_DECL
800 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
801 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
803 #else /* !YYPARSE_PARAM */
804 # define YYPARSE_PARAM_ARG
805 # define YYPARSE_PARAM_DECL
806 #endif /* !YYPARSE_PARAM */
808 /* Prevent warning if -Wstrict-prototypes. */
810 # ifdef YYPARSE_PARAM
811 int yyparse (void *);
818 /* The lookahead symbol. */
821 /* The semantic value of the lookahead symbol. */
824 /* Number of parse errors so far. */
829 yyparse (YYPARSE_PARAM_ARG)
833 register int yystate;
836 /* Number of tokens to shift before error messages enabled. */
838 /* Lookahead token as an internal (translated) token number. */
841 /* Three stacks and their tools:
842 `yyss': related to states,
843 `yyvs': related to semantic values,
844 `yyls': related to locations.
846 Refer to the stacks thru separate pointers, to allow yyoverflow
847 to reallocate them elsewhere. */
849 /* The state stack. */
850 short yyssa[YYINITDEPTH];
852 register short *yyssp;
854 /* The semantic value stack. */
855 YYSTYPE yyvsa[YYINITDEPTH];
856 YYSTYPE *yyvs = yyvsa;
857 register YYSTYPE *yyvsp;
861 #define YYPOPSTACK (yyvsp--, yyssp--)
863 YYSIZE_T yystacksize = YYINITDEPTH;
865 /* The variables used to return semantic value and location from the
870 /* When reducing, the number of symbols on the RHS of the reduced
874 YYDPRINTF ((stderr, "Starting parse\n"));
879 yychar = YYEMPTY; /* Cause a token to be read. */
881 /* Initialize stack pointers.
882 Waste one element of value and location stack
883 so that they stay on the same level as the state stack.
884 The wasted elements are never initialized. */
891 /*------------------------------------------------------------.
892 | yynewstate -- Push a new state, which is found in yystate. |
893 `------------------------------------------------------------*/
895 /* In all cases, when you get here, the value and location stacks
896 have just been pushed. so pushing a state here evens the stacks.
903 if (yyssp >= yyss + yystacksize - 1)
905 /* Get the current used size of the three stacks, in elements. */
906 YYSIZE_T yysize = yyssp - yyss + 1;
910 /* Give user a chance to reallocate the stack. Use copies of
911 these so that the &'s don't force the real ones into
913 YYSTYPE *yyvs1 = yyvs;
917 /* Each stack pointer address is followed by the size of the
918 data in use in that stack, in bytes. This used to be a
919 conditional around just the two extra args, but that might
920 be undefined if yyoverflow is a macro. */
921 yyoverflow ("parser stack overflow",
922 &yyss1, yysize * sizeof (*yyssp),
923 &yyvs1, yysize * sizeof (*yyvsp),
930 #else /* no yyoverflow */
931 # ifndef YYSTACK_RELOCATE
934 /* Extend the stack our own way. */
935 if (yystacksize >= YYMAXDEPTH)
938 if (yystacksize > YYMAXDEPTH)
939 yystacksize = YYMAXDEPTH;
943 union yyalloc *yyptr =
944 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
947 YYSTACK_RELOCATE (yyss);
948 YYSTACK_RELOCATE (yyvs);
950 # undef YYSTACK_RELOCATE
952 YYSTACK_FREE (yyss1);
955 #endif /* no yyoverflow */
957 yyssp = yyss + yysize - 1;
958 yyvsp = yyvs + yysize - 1;
961 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
962 (unsigned long int) yystacksize));
964 if (yyssp >= yyss + yystacksize - 1)
968 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
977 /* Do appropriate processing given the current state. */
978 /* Read a lookahead token if we need one and don't already have one. */
981 /* First try to decide what to do without reference to lookahead token. */
983 yyn = yypact[yystate];
984 if (yyn == YYPACT_NINF)
987 /* Not known => get a lookahead token if don't already have one. */
989 /* yychar is either YYEMPTY or YYEOF
990 or a valid token in external form. */
992 if (yychar == YYEMPTY)
994 YYDPRINTF ((stderr, "Reading a token: "));
998 /* Convert token to internal form (in yychar1) for indexing tables with. */
1000 if (yychar <= 0) /* This means end of input. */
1003 yychar = YYEOF; /* Don't call YYLEX any more. */
1005 YYDPRINTF ((stderr, "Now at end of input.\n"));
1009 yychar1 = YYTRANSLATE (yychar);
1011 /* We have to keep this `#if YYDEBUG', since we use variables
1012 which are defined only if `YYDEBUG' is set. */
1013 YYDPRINTF ((stderr, "Next token is "));
1014 YYDSYMPRINT ((stderr, yychar1, yylval));
1015 YYDPRINTF ((stderr, "\n"));
1018 /* If the proper action on seeing token YYCHAR1 is to reduce or to
1019 detect an error, take that action. */
1021 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
1026 if (yyn == 0 || yyn == YYTABLE_NINF)
1035 /* Shift the lookahead token. */
1036 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1037 yychar, yytname[yychar1]));
1039 /* Discard the token being shifted unless it is eof. */
1040 if (yychar != YYEOF)
1046 /* Count tokens shifted since error; after three, turn off error
1055 /*-----------------------------------------------------------.
1056 | yydefault -- do the default action for the current state. |
1057 `-----------------------------------------------------------*/
1059 yyn = yydefact[yystate];
1065 /*-----------------------------.
1066 | yyreduce -- Do a reduction. |
1067 `-----------------------------*/
1069 /* yyn is the number of a rule to reduce with. */
1072 /* If YYLEN is nonzero, implement the default value of the action:
1075 Otherwise, the following line sets YYVAL to garbage.
1076 This behavior is undocumented and Bison
1077 users should not rely upon it. Assigning to YYVAL
1078 unconditionally makes the parser a bit smaller, and it avoids a
1079 GCC warning that YYVAL may be used uninitialized. */
1080 yyval = yyvsp[1-yylen];
1085 /* We have to keep this `#if YYDEBUG', since we use variables which
1086 are defined only if `YYDEBUG' is set. */
1091 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1092 yyn - 1, yyrline[yyn]);
1094 /* Print the symbols being reduced, and their result. */
1095 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
1096 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1097 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1105 ifq_parse_result->parse_tree_list = yyvsp[0].q_list;
1106 ifq_parse_result->tables = NULL;
1107 ifq_parse_result->parse_type = QUERY_PARSE;
1114 yyval.tblp = yyvsp[0].tblp; yyval.tblp->nmap["name"] = yyvsp[-2].strval;
1120 {yyval.q_list = new query_list_t(yyvsp[0].tblp);}
1125 {yyval.q_list = yyvsp[-2].q_list->append(yyvsp[0].tblp);}
1130 {yyval.tblp = yyvsp[0].tblp;}
1135 {yyval.tblp=new table_exp_t(NULL,yyvsp[0].predp,NULL,NULL,NULL,NULL,NULL,NULL);}
1140 {yyval.predp = yyvsp[0].predp;}
1145 {yyval.predp=new predicate_t("OR",yyvsp[-2].predp,yyvsp[0].predp);}
1150 {yyval.predp=new predicate_t("AND",yyvsp[-2].predp,yyvsp[0].predp);}
1155 {yyval.predp = new predicate_t("NOT", yyvsp[0].predp );}
1160 {yyval.predp = yyvsp[-1].predp;}
1165 {yyval.predp = yyvsp[0].predp;}
1170 {yyval.predp = new predicate_t(yyvsp[-3].strval, yyvsp[-1].se_listval->get_se_list()); }
1175 { yyval.scalarval= scalarexp_t::make_param_reference(yyvsp[0].litval->to_string().c_str());}
1180 {yyval.scalarval = scalarexp_t::make_param_reference(yyvsp[0].strval);}
1185 { yyval.se_listval= new se_list_t(yyvsp[0].scalarval); }
1190 { yyval.se_listval=yyvsp[-2].se_listval->append(yyvsp[0].scalarval); }
1195 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_STRING);}
1200 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_INT);}
1205 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGINT);}
1210 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_FLOAT);}
1215 {yyval.litval = new literal_t("TRUE",LITERAL_BOOL);}
1220 {yyval.litval = new literal_t("FALSE",LITERAL_BOOL);}
1225 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_TIMEVAL);}
1230 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_HEX);}
1235 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGHEX);}
1240 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_IP);}
1246 /* Line 1016 of /usr/local/share/bison/yacc.c. */
1247 #line 1248 "ifq.tab.cc"
1256 short *yyssp1 = yyss - 1;
1257 YYFPRINTF (stderr, "state stack now");
1258 while (yyssp1 != yyssp)
1259 YYFPRINTF (stderr, " %d", *++yyssp1);
1260 YYFPRINTF (stderr, "\n");
1267 /* Now `shift' the result of the reduction. Determine what state
1268 that goes to, based on the state we popped back to and the rule
1269 number reduced by. */
1273 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1274 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1275 yystate = yytable[yystate];
1277 yystate = yydefgoto[yyn - YYNTOKENS];
1282 /*------------------------------------.
1283 | yyerrlab -- here on detecting error |
1284 `------------------------------------*/
1286 /* If not already recovering from an error, report this error. */
1291 yyn = yypact[yystate];
1293 if (YYPACT_NINF < yyn && yyn < YYLAST)
1295 YYSIZE_T yysize = 0;
1296 int yytype = YYTRANSLATE (yychar);
1301 /* Start YYX at -YYN if negative to avoid negative indexes in
1303 for (yyx = yyn < 0 ? -yyn : 0;
1304 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1305 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1306 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1307 yysize += yystrlen ("parse error, unexpected ") + 1;
1308 yysize += yystrlen (yytname[yytype]);
1309 yymsg = (char *) YYSTACK_ALLOC (yysize);
1312 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1313 yyp = yystpcpy (yyp, yytname[yytype]);
1318 for (yyx = yyn < 0 ? -yyn : 0;
1319 yyx < (int) (sizeof (yytname) / sizeof (char *));
1321 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1323 const char *yyq = ! yycount ? ", expecting " : " or ";
1324 yyp = yystpcpy (yyp, yyq);
1325 yyp = yystpcpy (yyp, yytname[yyx]);
1330 YYSTACK_FREE (yymsg);
1333 yyerror ("parse error; also virtual memory exhausted");
1336 #endif /* YYERROR_VERBOSE */
1337 yyerror ("parse error");
1342 /*----------------------------------------------------.
1343 | yyerrlab1 -- error raised explicitly by an action. |
1344 `----------------------------------------------------*/
1346 if (yyerrstatus == 3)
1348 /* If just tried and failed to reuse lookahead token after an
1349 error, discard it. */
1351 /* Return failure if at end of input. */
1352 if (yychar == YYEOF)
1354 /* Pop the error token. */
1356 /* Pop the rest of the stack. */
1357 while (yyssp > yyss)
1359 YYDPRINTF ((stderr, "Error: popping "));
1360 YYDSYMPRINT ((stderr,
1363 YYDPRINTF ((stderr, "\n"));
1364 yydestruct (yystos[*yyssp], *yyvsp);
1370 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1371 yychar, yytname[yychar1]));
1372 yydestruct (yychar1, yylval);
1376 /* Else will try to reuse lookahead token after shifting the error
1379 yyerrstatus = 3; /* Each real token shifted decrements this. */
1383 yyn = yypact[yystate];
1384 if (yyn != YYPACT_NINF)
1387 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1395 /* Pop the current state because it cannot handle the error token. */
1399 YYDPRINTF ((stderr, "Error: popping "));
1400 YYDSYMPRINT ((stderr,
1401 yystos[*yyssp], *yyvsp));
1402 YYDPRINTF ((stderr, "\n"));
1404 yydestruct (yystos[yystate], *yyvsp);
1412 short *yyssp1 = yyss - 1;
1413 YYFPRINTF (stderr, "Error: state stack now");
1414 while (yyssp1 != yyssp)
1415 YYFPRINTF (stderr, " %d", *++yyssp1);
1416 YYFPRINTF (stderr, "\n");
1424 YYDPRINTF ((stderr, "Shifting error token, "));
1433 /*-------------------------------------.
1434 | yyacceptlab -- YYACCEPT comes here. |
1435 `-------------------------------------*/
1440 /*-----------------------------------.
1441 | yyabortlab -- YYABORT comes here. |
1442 `-----------------------------------*/
1448 /*----------------------------------------------.
1449 | yyoverflowlab -- parser overflow comes here. |
1450 `----------------------------------------------*/
1452 yyerror ("parser stack overflow");
1460 YYSTACK_FREE (yyss);