Add new udafs and RMR support to gsprintconsole_ves
[com/gs-lite.git] / src / ftacmp / ifq.tab.cc
1 /* A Bison parser, made from ifq.y, by GNU bison 1.75.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
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)
9    any later version.
10
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.
15
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.  */
20
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.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
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.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Pure parsers.  */
40 #define YYPURE  0
41
42 /* Using locations.  */
43 #define YYLSP_NEEDED 0
44
45 /* If NAME_PREFIX is specified substitute the variables and functions
46    names.  */
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
54
55
56 /* Tokens.  */
57 #ifndef YYTOKENTYPE
58 # define YYTOKENTYPE
59    /* Put the tokens into the symbol table, so that GDB and other debuggers
60       know about them.  */
61    enum yytokentype {
62      NAME = 258,
63      PRED = 259,
64      STRING_TOKEN = 260,
65      INTNUM = 261,
66      LONGINTNUM = 262,
67      APPROXNUM = 263,
68      OR = 264,
69      AND = 265,
70      NOT = 266,
71      SEMICOLON = 267,
72      LEFTBRACE = 268,
73      RIGHTBRACE = 269,
74      BY = 270,
75      AS = 271,
76      AGGR = 272,
77      FROM = 273,
78      INNER_JOIN = 274,
79      OUTER_JOIN = 275,
80      LEFT_OUTER_JOIN = 276,
81      RIGHT_OUTER_JOIN = 277,
82      GROUP = 278,
83      HAVING = 279,
84      IN = 280,
85      SELECT = 281,
86      WHERE = 282,
87      SUCH = 283,
88      THAT = 284,
89      TRUE_V = 285,
90      FALSE_V = 286,
91      TIMEVAL_L = 287,
92      HEX_L = 288,
93      LHEX_L = 289,
94      IP_L = 290,
95      MERGE = 291,
96      SLACK = 292,
97      DEFINE_SEC = 293,
98      PARAM_SEC = 294,
99      PROTOCOL = 295,
100      TABLE = 296,
101      STREAM = 297,
102      FTA = 298,
103      OPERATOR = 299,
104      OPERATOR_VIEW = 300,
105      FIELDS = 301,
106      SUBQUERIES = 302,
107      SELECTION_PUSHDOWN = 303
108    };
109 #endif
110 #define NAME 258
111 #define PRED 259
112 #define STRING_TOKEN 260
113 #define INTNUM 261
114 #define LONGINTNUM 262
115 #define APPROXNUM 263
116 #define OR 264
117 #define AND 265
118 #define NOT 266
119 #define SEMICOLON 267
120 #define LEFTBRACE 268
121 #define RIGHTBRACE 269
122 #define BY 270
123 #define AS 271
124 #define AGGR 272
125 #define FROM 273
126 #define INNER_JOIN 274
127 #define OUTER_JOIN 275
128 #define LEFT_OUTER_JOIN 276
129 #define RIGHT_OUTER_JOIN 277
130 #define GROUP 278
131 #define HAVING 279
132 #define IN 280
133 #define SELECT 281
134 #define WHERE 282
135 #define SUCH 283
136 #define THAT 284
137 #define TRUE_V 285
138 #define FALSE_V 286
139 #define TIMEVAL_L 287
140 #define HEX_L 288
141 #define LHEX_L 289
142 #define IP_L 290
143 #define MERGE 291
144 #define SLACK 292
145 #define DEFINE_SEC 293
146 #define PARAM_SEC 294
147 #define PROTOCOL 295
148 #define TABLE 296
149 #define STREAM 297
150 #define FTA 298
151 #define OPERATOR 299
152 #define OPERATOR_VIEW 300
153 #define FIELDS 301
154 #define SUBQUERIES 302
155 #define SELECTION_PUSHDOWN 303
156
157
158
159
160 /* Copy the first part of user declarations.  */
161 #line 8 "ifq.y"
162
163
164
165 #include <stdio.h>
166
167 /*              Some addn'l includes, necessary but not included by the
168                 bison generated code.
169 */
170
171 #include <stdlib.h>
172
173 /*              prototypes for the parser callbacks.
174 */
175
176 #include "parse_fta.h"
177
178
179 extern fta_parse_t *ifq_parse_result;
180
181
182 #define YYDEBUG 1
183
184
185
186 /* Enabling traces.  */
187 #ifndef YYDEBUG
188 # define YYDEBUG 0
189 #endif
190
191 /* Enabling verbose error messages.  */
192 #ifdef YYERROR_VERBOSE
193 # undef YYERROR_VERBOSE
194 # define YYERROR_VERBOSE 1
195 #else
196 # define YYERROR_VERBOSE 0
197 #endif
198
199 #ifndef YYSTYPE
200 #line 35 "ifq.y"
201 typedef union {
202         int intval;
203         double floatval;
204         char *strval;
205         int subtok;
206
207 /*                      for FTA definition.     */
208         literal_t *litval;
209         scalarexp_t *scalarval;
210         se_list_t *se_listval;
211         select_list_t *select_listval;
212         table_exp_t *tblp;
213         predicate_t *predp;
214         literal_list_t *lit_l;
215         tablevar_t *table;
216         tablevar_list_t *tbl_list;
217         colref_t *colref;
218         colref_list_t *clist;
219         var_defs_t *var_defs;
220         var_pair_t *var_pair;
221         gb_t *gb_val;
222         gb_list_t *gb_list;
223
224         query_list_t *q_list;
225
226
227 } yystype;
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
232 #endif
233
234 #ifndef YYLTYPE
235 typedef struct yyltype
236 {
237   int first_line;
238   int first_column;
239   int last_line;
240   int last_column;
241 } yyltype;
242 # define YYLTYPE yyltype
243 # define YYLTYPE_IS_TRIVIAL 1
244 #endif
245
246 /* Copy the second part of user declarations.  */
247
248
249 /* Line 213 of /usr/local/share/bison/yacc.c.  */
250 #line 251 "ifq.tab.cc"
251
252 #if ! defined (yyoverflow) || YYERROR_VERBOSE
253
254 /* The parser invokes alloca or malloc; define the necessary symbols.  */
255
256 # if YYSTACK_USE_ALLOCA
257 #  define YYSTACK_ALLOC alloca
258 # else
259 #  ifndef YYSTACK_USE_ALLOCA
260 #   if defined (alloca) || defined (_ALLOCA_H)
261 #    define YYSTACK_ALLOC alloca
262 #   else
263 #    ifdef __GNUC__
264 #     define YYSTACK_ALLOC __builtin_alloca
265 #    endif
266 #   endif
267 #  endif
268 # endif
269
270 # ifdef YYSTACK_ALLOC
271    /* Pacify GCC's `empty if-body' warning. */
272 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
273 # else
274 #  if defined (__STDC__) || defined (__cplusplus)
275 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
276 #   define YYSIZE_T size_t
277 #  endif
278 #  define YYSTACK_ALLOC malloc
279 #  define YYSTACK_FREE free
280 # endif
281 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
282
283
284 #if (! defined (yyoverflow) \
285      && (! defined (__cplusplus) \
286          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
287
288 /* A type that is properly aligned for any stack member.  */
289 union yyalloc
290 {
291   short yyss;
292   YYSTYPE yyvs;
293   };
294
295 /* The size of the maximum gap between one aligned stack and the next.  */
296 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
297
298 /* The size of an array large to enough to hold all stacks, each with
299    N elements.  */
300 # define YYSTACK_BYTES(N) \
301      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
302       + YYSTACK_GAP_MAX)
303
304 /* Copy COUNT objects from FROM to TO.  The source and destination do
305    not overlap.  */
306 # ifndef YYCOPY
307 #  if 1 < __GNUC__
308 #   define YYCOPY(To, From, Count) \
309       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
310 #  else
311 #   define YYCOPY(To, From, Count)              \
312       do                                        \
313         {                                       \
314           register YYSIZE_T yyi;                \
315           for (yyi = 0; yyi < (Count); yyi++)   \
316             (To)[yyi] = (From)[yyi];    \
317         }                                       \
318       while (0)
319 #  endif
320 # endif
321
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
326    stack.  */
327 # define YYSTACK_RELOCATE(Stack)                                        \
328     do                                                                  \
329       {                                                                 \
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);                          \
335       }                                                                 \
336     while (0)
337
338 #endif
339
340 #if defined (__STDC__) || defined (__cplusplus)
341    typedef signed char yysigned_char;
342 #else
343    typedef short yysigned_char;
344 #endif
345
346 /* YYFINAL -- State number of the termination state. */
347 #define YYFINAL  6
348 #define YYLAST   46
349
350 /* YYNTOKENS -- Number of terminals. */
351 #define YYNTOKENS  55
352 /* YYNNTS -- Number of nonterminals. */
353 #define YYNNTS  12
354 /* YYNRULES -- Number of rules. */
355 #define YYNRULES  28
356 /* YYNRULES -- Number of states. */
357 #define YYNSTATES  46
358
359 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
360 #define YYUNDEFTOK  2
361 #define YYMAXUTOK   303
362
363 #define YYTRANSLATE(X) \
364   ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
365
366 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
367 static const unsigned char yytranslate[] =
368 {
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,
399       45,    46,    47,    48
400 };
401
402 #if YYDEBUG
403 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
404    YYRHS.  */
405 static const unsigned char yyprhs[] =
406 {
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
410 };
411
412 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
413 static const yysigned_char yyrhs[] =
414 {
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
423 };
424
425 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
426 static const unsigned char yyrline[] =
427 {
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
431 };
432 #endif
433
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[] =
438 {
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
450 };
451 #endif
452
453 # ifdef YYPRINT
454 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
455    token YYLEX-NUM.  */
456 static const unsigned short yytoknum[] =
457 {
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,
463       40,    41,    91,    93,    44
464 };
465 # endif
466
467 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
468 static const unsigned char yyr1[] =
469 {
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
473 };
474
475 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
476 static const unsigned char yyr2[] =
477 {
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
481 };
482
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[] =
487 {
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
493 };
494
495 /* YYDEFGOTO[NTERM-NUM]. */
496 static const yysigned_char yydefgoto[] =
497 {
498       -1,     2,     3,     4,    11,    12,    13,    14,    15,    33,
499       34,    35
500 };
501
502 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
503    STATE-NUM.  */
504 #define YYPACT_NINF -42
505 static const yysigned_char yypact[] =
506 {
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
512 };
513
514 /* YYPGOTO[NTERM-NUM].  */
515 static const yysigned_char yypgoto[] =
516 {
517      -42,   -42,    22,   -42,   -42,   -42,   -42,    -6,   -42,   -17,
518      -42,   -42
519 };
520
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[] =
527 {
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
533 };
534
535 static const yysigned_char yycheck[] =
536 {
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
542 };
543
544 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
545    symbol of state STATE-NUM.  */
546 static const unsigned char yystos[] =
547 {
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,
552        5,     5,     5,    53,    54,    64
553 };
554
555 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
556 # define YYSIZE_T __SIZE_TYPE__
557 #endif
558 #if ! defined (YYSIZE_T) && defined (size_t)
559 # define YYSIZE_T size_t
560 #endif
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
565 # endif
566 #endif
567 #if ! defined (YYSIZE_T)
568 # define YYSIZE_T unsigned int
569 #endif
570
571 #define yyerrok         (yyerrstatus = 0)
572 #define yyclearin       (yychar = YYEMPTY)
573 #define YYEMPTY         -2
574 #define YYEOF           0
575
576 #define YYACCEPT        goto yyacceptlab
577 #define YYABORT         goto yyabortlab
578 #define YYERROR         goto yyerrlab1
579
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.  */
583
584 #define YYFAIL          goto yyerrlab
585
586 #define YYRECOVERING()  (!!yyerrstatus)
587
588 #define YYBACKUP(Token, Value)                                  \
589 do                                                              \
590   if (yychar == YYEMPTY && yylen == 1)                          \
591     {                                                           \
592       yychar = (Token);                                         \
593       yylval = (Value);                                         \
594       yychar1 = YYTRANSLATE (yychar);                           \
595       YYPOPSTACK;                                               \
596       goto yybackup;                                            \
597     }                                                           \
598   else                                                          \
599     {                                                           \
600       yyerror ("syntax error: cannot back up");                 \
601       YYERROR;                                                  \
602     }                                                           \
603 while (0)
604
605 #define YYTERROR        1
606 #define YYERRCODE       256
607
608 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
609    are run).  */
610
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;
617 #endif
618
619 /* YYLEX -- calling `yylex' with the right arguments.  */
620
621 #define YYLEX   yylex ()
622
623 /* Enable debugging if requested.  */
624 #if YYDEBUG
625
626 # ifndef YYFPRINTF
627 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
628 #  define YYFPRINTF fprintf
629 # endif
630
631 # define YYDPRINTF(Args)                        \
632 do {                                            \
633   if (yydebug)                                  \
634     YYFPRINTF Args;                             \
635 } while (0)
636 # define YYDSYMPRINT(Args)                      \
637 do {                                            \
638   if (yydebug)                                  \
639     yysymprint Args;                            \
640 } while (0)
641 /* Nonzero means print parse trace.  It is left uninitialized so that
642    multiple parsers can coexist.  */
643 int yydebug;
644 #else /* !YYDEBUG */
645 # define YYDPRINTF(Args)
646 # define YYDSYMPRINT(Args)
647 #endif /* !YYDEBUG */
648
649 /* YYINITDEPTH -- initial size of the parser's stacks.  */
650 #ifndef YYINITDEPTH
651 # define YYINITDEPTH 200
652 #endif
653
654 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
655    if the built-in stack extension method is used).
656
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.  */
660
661 #if YYMAXDEPTH == 0
662 # undef YYMAXDEPTH
663 #endif
664
665 #ifndef YYMAXDEPTH
666 # define YYMAXDEPTH 10000
667 #endif
668
669 \f
670
671 #if YYERROR_VERBOSE
672
673 # ifndef yystrlen
674 #  if defined (__GLIBC__) && defined (_STRING_H)
675 #   define yystrlen strlen
676 #  else
677 /* Return the length of YYSTR.  */
678 static YYSIZE_T
679 #   if defined (__STDC__) || defined (__cplusplus)
680 yystrlen (const char *yystr)
681 #   else
682 yystrlen (yystr)
683      const char *yystr;
684 #   endif
685 {
686   register const char *yys = yystr;
687
688   while (*yys++ != '\0')
689     continue;
690
691   return yys - yystr - 1;
692 }
693 #  endif
694 # endif
695
696 # ifndef yystpcpy
697 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
698 #   define yystpcpy stpcpy
699 #  else
700 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
701    YYDEST.  */
702 static char *
703 #   if defined (__STDC__) || defined (__cplusplus)
704 yystpcpy (char *yydest, const char *yysrc)
705 #   else
706 yystpcpy (yydest, yysrc)
707      char *yydest;
708      const char *yysrc;
709 #   endif
710 {
711   register char *yyd = yydest;
712   register const char *yys = yysrc;
713
714   while ((*yyd++ = *yys++) != '\0')
715     continue;
716
717   return yyd - 1;
718 }
719 #  endif
720 # endif
721
722 #endif /* !YYERROR_VERBOSE */
723
724 \f
725
726 #if YYDEBUG
727 /*-----------------------------.
728 | Print this symbol on YYOUT.  |
729 `-----------------------------*/
730
731 static void
732 #if defined (__STDC__) || defined (__cplusplus)
733 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
734 #else
735 yysymprint (yyout, yytype, yyvalue)
736     FILE* yyout;
737     int yytype;
738     YYSTYPE yyvalue;
739 #endif
740 {
741   /* Pacify ``unused variable'' warnings.  */
742   (void) yyvalue;
743
744   if (yytype < YYNTOKENS)
745     {
746       YYFPRINTF (yyout, "token %s (", yytname[yytype]);
747 # ifdef YYPRINT
748       YYPRINT (yyout, yytoknum[yytype], yyvalue);
749 # endif
750     }
751   else
752     YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
753
754   switch (yytype)
755     {
756       default:
757         break;
758     }
759   YYFPRINTF (yyout, ")");
760 }
761 #endif /* YYDEBUG. */
762
763
764 /*-----------------------------------------------.
765 | Release the memory associated to this symbol.  |
766 `-----------------------------------------------*/
767
768 static void
769 #if defined (__STDC__) || defined (__cplusplus)
770 yydestruct (int yytype, YYSTYPE yyvalue)
771 #else
772 yydestruct (yytype, yyvalue)
773     int yytype;
774     YYSTYPE yyvalue;
775 #endif
776 {
777   /* Pacify ``unused variable'' warnings.  */
778   (void) yyvalue;
779
780   switch (yytype)
781     {
782       default:
783         break;
784     }
785 }
786
787 \f
788
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.  */
794
795 #ifdef YYPARSE_PARAM
796 # if defined (__STDC__) || defined (__cplusplus)
797 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
798 #  define YYPARSE_PARAM_DECL
799 # else
800 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
801 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
802 # endif
803 #else /* !YYPARSE_PARAM */
804 # define YYPARSE_PARAM_ARG
805 # define YYPARSE_PARAM_DECL
806 #endif /* !YYPARSE_PARAM */
807
808 /* Prevent warning if -Wstrict-prototypes.  */
809 #ifdef __GNUC__
810 # ifdef YYPARSE_PARAM
811 int yyparse (void *);
812 # else
813 int yyparse (void);
814 # endif
815 #endif
816
817
818 /* The lookahead symbol.  */
819 int yychar;
820
821 /* The semantic value of the lookahead symbol.  */
822 YYSTYPE yylval;
823
824 /* Number of parse errors so far.  */
825 int yynerrs;
826
827
828 int
829 yyparse (YYPARSE_PARAM_ARG)
830      YYPARSE_PARAM_DECL
831 {
832   
833   register int yystate;
834   register int yyn;
835   int yyresult;
836   /* Number of tokens to shift before error messages enabled.  */
837   int yyerrstatus;
838   /* Lookahead token as an internal (translated) token number.  */
839   int yychar1 = 0;
840
841   /* Three stacks and their tools:
842      `yyss': related to states,
843      `yyvs': related to semantic values,
844      `yyls': related to locations.
845
846      Refer to the stacks thru separate pointers, to allow yyoverflow
847      to reallocate them elsewhere.  */
848
849   /* The state stack.  */
850   short yyssa[YYINITDEPTH];
851   short *yyss = yyssa;
852   register short *yyssp;
853
854   /* The semantic value stack.  */
855   YYSTYPE yyvsa[YYINITDEPTH];
856   YYSTYPE *yyvs = yyvsa;
857   register YYSTYPE *yyvsp;
858
859
860
861 #define YYPOPSTACK   (yyvsp--, yyssp--)
862
863   YYSIZE_T yystacksize = YYINITDEPTH;
864
865   /* The variables used to return semantic value and location from the
866      action routines.  */
867   YYSTYPE yyval;
868
869
870   /* When reducing, the number of symbols on the RHS of the reduced
871      rule.  */
872   int yylen;
873
874   YYDPRINTF ((stderr, "Starting parse\n"));
875
876   yystate = 0;
877   yyerrstatus = 0;
878   yynerrs = 0;
879   yychar = YYEMPTY;             /* Cause a token to be read.  */
880
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.  */
885
886   yyssp = yyss;
887   yyvsp = yyvs;
888
889   goto yysetstate;
890
891 /*------------------------------------------------------------.
892 | yynewstate -- Push a new state, which is found in yystate.  |
893 `------------------------------------------------------------*/
894  yynewstate:
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.
897      */
898   yyssp++;
899
900  yysetstate:
901   *yyssp = yystate;
902
903   if (yyssp >= yyss + yystacksize - 1)
904     {
905       /* Get the current used size of the three stacks, in elements.  */
906       YYSIZE_T yysize = yyssp - yyss + 1;
907
908 #ifdef yyoverflow
909       {
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
912            memory.  */
913         YYSTYPE *yyvs1 = yyvs;
914         short *yyss1 = yyss;
915
916
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),
924
925                     &yystacksize);
926
927         yyss = yyss1;
928         yyvs = yyvs1;
929       }
930 #else /* no yyoverflow */
931 # ifndef YYSTACK_RELOCATE
932       goto yyoverflowlab;
933 # else
934       /* Extend the stack our own way.  */
935       if (yystacksize >= YYMAXDEPTH)
936         goto yyoverflowlab;
937       yystacksize *= 2;
938       if (yystacksize > YYMAXDEPTH)
939         yystacksize = YYMAXDEPTH;
940
941       {
942         short *yyss1 = yyss;
943         union yyalloc *yyptr =
944           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
945         if (! yyptr)
946           goto yyoverflowlab;
947         YYSTACK_RELOCATE (yyss);
948         YYSTACK_RELOCATE (yyvs);
949
950 #  undef YYSTACK_RELOCATE
951         if (yyss1 != yyssa)
952           YYSTACK_FREE (yyss1);
953       }
954 # endif
955 #endif /* no yyoverflow */
956
957       yyssp = yyss + yysize - 1;
958       yyvsp = yyvs + yysize - 1;
959
960
961       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
962                   (unsigned long int) yystacksize));
963
964       if (yyssp >= yyss + yystacksize - 1)
965         YYABORT;
966     }
967
968   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
969
970   goto yybackup;
971
972 /*-----------.
973 | yybackup.  |
974 `-----------*/
975 yybackup:
976
977 /* Do appropriate processing given the current state.  */
978 /* Read a lookahead token if we need one and don't already have one.  */
979 /* yyresume: */
980
981   /* First try to decide what to do without reference to lookahead token.  */
982
983   yyn = yypact[yystate];
984   if (yyn == YYPACT_NINF)
985     goto yydefault;
986
987   /* Not known => get a lookahead token if don't already have one.  */
988
989   /* yychar is either YYEMPTY or YYEOF
990      or a valid token in external form.  */
991
992   if (yychar == YYEMPTY)
993     {
994       YYDPRINTF ((stderr, "Reading a token: "));
995       yychar = YYLEX;
996     }
997
998   /* Convert token to internal form (in yychar1) for indexing tables with.  */
999
1000   if (yychar <= 0)              /* This means end of input.  */
1001     {
1002       yychar1 = 0;
1003       yychar = YYEOF;           /* Don't call YYLEX any more.  */
1004
1005       YYDPRINTF ((stderr, "Now at end of input.\n"));
1006     }
1007   else
1008     {
1009       yychar1 = YYTRANSLATE (yychar);
1010
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"));
1016     }
1017
1018   /* If the proper action on seeing token YYCHAR1 is to reduce or to
1019      detect an error, take that action.  */
1020   yyn += yychar1;
1021   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
1022     goto yydefault;
1023   yyn = yytable[yyn];
1024   if (yyn <= 0)
1025     {
1026       if (yyn == 0 || yyn == YYTABLE_NINF)
1027         goto yyerrlab;
1028       yyn = -yyn;
1029       goto yyreduce;
1030     }
1031
1032   if (yyn == YYFINAL)
1033     YYACCEPT;
1034
1035   /* Shift the lookahead token.  */
1036   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1037               yychar, yytname[yychar1]));
1038
1039   /* Discard the token being shifted unless it is eof.  */
1040   if (yychar != YYEOF)
1041     yychar = YYEMPTY;
1042
1043   *++yyvsp = yylval;
1044
1045
1046   /* Count tokens shifted since error; after three, turn off error
1047      status.  */
1048   if (yyerrstatus)
1049     yyerrstatus--;
1050
1051   yystate = yyn;
1052   goto yynewstate;
1053
1054
1055 /*-----------------------------------------------------------.
1056 | yydefault -- do the default action for the current state.  |
1057 `-----------------------------------------------------------*/
1058 yydefault:
1059   yyn = yydefact[yystate];
1060   if (yyn == 0)
1061     goto yyerrlab;
1062   goto yyreduce;
1063
1064
1065 /*-----------------------------.
1066 | yyreduce -- Do a reduction.  |
1067 `-----------------------------*/
1068 yyreduce:
1069   /* yyn is the number of a rule to reduce with.  */
1070   yylen = yyr2[yyn];
1071
1072   /* If YYLEN is nonzero, implement the default value of the action:
1073      `$$ = $1'.
1074
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];
1081
1082
1083
1084 #if YYDEBUG
1085   /* We have to keep this `#if YYDEBUG', since we use variables which
1086      are defined only if `YYDEBUG' is set.  */
1087   if (yydebug)
1088     {
1089       int yyi;
1090
1091       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1092                  yyn - 1, yyrline[yyn]);
1093
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]]);
1098     }
1099 #endif
1100   switch (yyn)
1101     {
1102         case 2:
1103 #line 117 "ifq.y"
1104     {
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;
1108         }
1109     break;
1110
1111   case 3:
1112 #line 130 "ifq.y"
1113     {
1114                                 yyval.tblp = yyvsp[0].tblp; yyval.tblp->nmap["name"] = yyvsp[-2].strval;
1115                         }
1116     break;
1117
1118   case 4:
1119 #line 135 "ifq.y"
1120     {yyval.q_list = new query_list_t(yyvsp[0].tblp);}
1121     break;
1122
1123   case 5:
1124 #line 136 "ifq.y"
1125     {yyval.q_list = yyvsp[-2].q_list->append(yyvsp[0].tblp);}
1126     break;
1127
1128   case 6:
1129 #line 141 "ifq.y"
1130     {yyval.tblp = yyvsp[0].tblp;}
1131     break;
1132
1133   case 7:
1134 #line 150 "ifq.y"
1135     {yyval.tblp=new table_exp_t(NULL,yyvsp[0].predp,NULL,NULL,NULL,NULL,NULL,NULL);}
1136     break;
1137
1138   case 8:
1139 #line 156 "ifq.y"
1140     {yyval.predp = yyvsp[0].predp;}
1141     break;
1142
1143   case 9:
1144 #line 164 "ifq.y"
1145     {yyval.predp=new predicate_t("OR",yyvsp[-2].predp,yyvsp[0].predp);}
1146     break;
1147
1148   case 10:
1149 #line 165 "ifq.y"
1150     {yyval.predp=new predicate_t("AND",yyvsp[-2].predp,yyvsp[0].predp);}
1151     break;
1152
1153   case 11:
1154 #line 166 "ifq.y"
1155     {yyval.predp = new predicate_t("NOT", yyvsp[0].predp );}
1156     break;
1157
1158   case 12:
1159 #line 167 "ifq.y"
1160     {yyval.predp = yyvsp[-1].predp;}
1161     break;
1162
1163   case 13:
1164 #line 168 "ifq.y"
1165     {yyval.predp = yyvsp[0].predp;}
1166     break;
1167
1168   case 14:
1169 #line 172 "ifq.y"
1170     {yyval.predp = new predicate_t(yyvsp[-3].strval, yyvsp[-1].se_listval->get_se_list()); }
1171     break;
1172
1173   case 15:
1174 #line 179 "ifq.y"
1175     { yyval.scalarval= scalarexp_t::make_param_reference(yyvsp[0].litval->to_string().c_str());}
1176     break;
1177
1178   case 16:
1179 #line 180 "ifq.y"
1180     {yyval.scalarval = scalarexp_t::make_param_reference(yyvsp[0].strval);}
1181     break;
1182
1183   case 17:
1184 #line 185 "ifq.y"
1185     {   yyval.se_listval= new se_list_t(yyvsp[0].scalarval); }
1186     break;
1187
1188   case 18:
1189 #line 186 "ifq.y"
1190     { yyval.se_listval=yyvsp[-2].se_listval->append(yyvsp[0].scalarval); }
1191     break;
1192
1193   case 19:
1194 #line 190 "ifq.y"
1195     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_STRING);}
1196     break;
1197
1198   case 20:
1199 #line 191 "ifq.y"
1200     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_INT);}
1201     break;
1202
1203   case 21:
1204 #line 192 "ifq.y"
1205     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGINT);}
1206     break;
1207
1208   case 22:
1209 #line 193 "ifq.y"
1210     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_FLOAT);}
1211     break;
1212
1213   case 23:
1214 #line 194 "ifq.y"
1215     {yyval.litval = new literal_t("TRUE",LITERAL_BOOL);}
1216     break;
1217
1218   case 24:
1219 #line 195 "ifq.y"
1220     {yyval.litval = new literal_t("FALSE",LITERAL_BOOL);}
1221     break;
1222
1223   case 25:
1224 #line 196 "ifq.y"
1225     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_TIMEVAL);}
1226     break;
1227
1228   case 26:
1229 #line 197 "ifq.y"
1230     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_HEX);}
1231     break;
1232
1233   case 27:
1234 #line 198 "ifq.y"
1235     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGHEX);}
1236     break;
1237
1238   case 28:
1239 #line 199 "ifq.y"
1240     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_IP);}
1241     break;
1242
1243
1244     }
1245
1246 /* Line 1016 of /usr/local/share/bison/yacc.c.  */
1247 #line 1248 "ifq.tab.cc"
1248 \f
1249   yyvsp -= yylen;
1250   yyssp -= yylen;
1251
1252
1253 #if YYDEBUG
1254   if (yydebug)
1255     {
1256       short *yyssp1 = yyss - 1;
1257       YYFPRINTF (stderr, "state stack now");
1258       while (yyssp1 != yyssp)
1259         YYFPRINTF (stderr, " %d", *++yyssp1);
1260       YYFPRINTF (stderr, "\n");
1261     }
1262 #endif
1263
1264   *++yyvsp = yyval;
1265
1266
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.  */
1270
1271   yyn = yyr1[yyn];
1272
1273   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1274   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1275     yystate = yytable[yystate];
1276   else
1277     yystate = yydefgoto[yyn - YYNTOKENS];
1278
1279   goto yynewstate;
1280
1281
1282 /*------------------------------------.
1283 | yyerrlab -- here on detecting error |
1284 `------------------------------------*/
1285 yyerrlab:
1286   /* If not already recovering from an error, report this error.  */
1287   if (!yyerrstatus)
1288     {
1289       ++yynerrs;
1290 #if YYERROR_VERBOSE
1291       yyn = yypact[yystate];
1292
1293       if (YYPACT_NINF < yyn && yyn < YYLAST)
1294         {
1295           YYSIZE_T yysize = 0;
1296           int yytype = YYTRANSLATE (yychar);
1297           char *yymsg;
1298           int yyx, yycount;
1299
1300           yycount = 0;
1301           /* Start YYX at -YYN if negative to avoid negative indexes in
1302              YYCHECK.  */
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);
1310           if (yymsg != 0)
1311             {
1312               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1313               yyp = yystpcpy (yyp, yytname[yytype]);
1314
1315               if (yycount < 5)
1316                 {
1317                   yycount = 0;
1318                   for (yyx = yyn < 0 ? -yyn : 0;
1319                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1320                        yyx++)
1321                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1322                       {
1323                         const char *yyq = ! yycount ? ", expecting " : " or ";
1324                         yyp = yystpcpy (yyp, yyq);
1325                         yyp = yystpcpy (yyp, yytname[yyx]);
1326                         yycount++;
1327                       }
1328                 }
1329               yyerror (yymsg);
1330               YYSTACK_FREE (yymsg);
1331             }
1332           else
1333             yyerror ("parse error; also virtual memory exhausted");
1334         }
1335       else
1336 #endif /* YYERROR_VERBOSE */
1337         yyerror ("parse error");
1338     }
1339   goto yyerrlab1;
1340
1341
1342 /*----------------------------------------------------.
1343 | yyerrlab1 -- error raised explicitly by an action.  |
1344 `----------------------------------------------------*/
1345 yyerrlab1:
1346   if (yyerrstatus == 3)
1347     {
1348       /* If just tried and failed to reuse lookahead token after an
1349          error, discard it.  */
1350
1351       /* Return failure if at end of input.  */
1352       if (yychar == YYEOF)
1353         {
1354           /* Pop the error token.  */
1355           YYPOPSTACK;
1356           /* Pop the rest of the stack.  */
1357           while (yyssp > yyss)
1358             {
1359               YYDPRINTF ((stderr, "Error: popping "));
1360               YYDSYMPRINT ((stderr,
1361                             yystos[*yyssp],
1362                             *yyvsp));
1363               YYDPRINTF ((stderr, "\n"));
1364               yydestruct (yystos[*yyssp], *yyvsp);
1365               YYPOPSTACK;
1366             }
1367           YYABORT;
1368         }
1369
1370       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1371                   yychar, yytname[yychar1]));
1372       yydestruct (yychar1, yylval);
1373       yychar = YYEMPTY;
1374     }
1375
1376   /* Else will try to reuse lookahead token after shifting the error
1377      token.  */
1378
1379   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1380
1381   for (;;)
1382     {
1383       yyn = yypact[yystate];
1384       if (yyn != YYPACT_NINF)
1385         {
1386           yyn += YYTERROR;
1387           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1388             {
1389               yyn = yytable[yyn];
1390               if (0 < yyn)
1391                 break;
1392             }
1393         }
1394
1395       /* Pop the current state because it cannot handle the error token.  */
1396       if (yyssp == yyss)
1397         YYABORT;
1398
1399       YYDPRINTF ((stderr, "Error: popping "));
1400       YYDSYMPRINT ((stderr,
1401                     yystos[*yyssp], *yyvsp));
1402       YYDPRINTF ((stderr, "\n"));
1403
1404       yydestruct (yystos[yystate], *yyvsp);
1405       yyvsp--;
1406       yystate = *--yyssp;
1407
1408
1409 #if YYDEBUG
1410       if (yydebug)
1411         {
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");
1417         }
1418 #endif
1419     }
1420
1421   if (yyn == YYFINAL)
1422     YYACCEPT;
1423
1424   YYDPRINTF ((stderr, "Shifting error token, "));
1425
1426   *++yyvsp = yylval;
1427
1428
1429   yystate = yyn;
1430   goto yynewstate;
1431
1432
1433 /*-------------------------------------.
1434 | yyacceptlab -- YYACCEPT comes here.  |
1435 `-------------------------------------*/
1436 yyacceptlab:
1437   yyresult = 0;
1438   goto yyreturn;
1439
1440 /*-----------------------------------.
1441 | yyabortlab -- YYABORT comes here.  |
1442 `-----------------------------------*/
1443 yyabortlab:
1444   yyresult = 1;
1445   goto yyreturn;
1446
1447 #ifndef yyoverflow
1448 /*----------------------------------------------.
1449 | yyoverflowlab -- parser overflow comes here.  |
1450 `----------------------------------------------*/
1451 yyoverflowlab:
1452   yyerror ("parser stack overflow");
1453   yyresult = 2;
1454   /* Fall through.  */
1455 #endif
1456
1457 yyreturn:
1458 #ifndef yyoverflow
1459   if (yyss != yyssa)
1460     YYSTACK_FREE (yyss);
1461 #endif
1462   return yyresult;
1463 }
1464
1465
1466 #line 204 "ifq.y"
1467
1468
1469