Added quantiling UDAFs
[com/gs-lite.git] / src / ftacmp / res.tab.cc
1 /* A Bison parser, made from res.y, by GNU bison 1.75.  */\r
2 \r
3 /* Skeleton parser for Yacc-like parsing with Bison,\r
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.\r
5 \r
6    This program is free software; you can redistribute it and/or modify\r
7    it under the terms of the GNU General Public License as published by\r
8    the Free Software Foundation; either version 2, or (at your option)\r
9    any later version.\r
10 \r
11    This program is distributed in the hope that it will be useful,\r
12    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14    GNU General Public License for more details.\r
15 \r
16    You should have received a copy of the GNU General Public License\r
17    along with this program; if not, write to the Free Software\r
18    Foundation, Inc., 59 Temple Place - Suite 330,\r
19    Boston, MA 02111-1307, USA.  */\r
20 \r
21 /* As a special exception, when this file is copied by Bison into a\r
22    Bison output file, you may use that output file without restriction.\r
23    This special exception was added by the Free Software Foundation\r
24    in version 1.24 of Bison.  */\r
25 \r
26 /* Written by Richard Stallman by simplifying the original so called\r
27    ``semantic'' parser.  */\r
28 \r
29 /* All symbols defined below should begin with yy or YY, to avoid\r
30    infringing on user name space.  This should be done even for local\r
31    variables, as they might otherwise be expanded by user macros.\r
32    There are some unavoidable exceptions within include files to\r
33    define necessary library symbols; they are noted "INFRINGES ON\r
34    USER NAME SPACE" below.  */\r
35 \r
36 /* Identify Bison output.  */\r
37 #define YYBISON 1\r
38 \r
39 /* Pure parsers.  */\r
40 #define YYPURE  0\r
41 \r
42 /* Using locations.  */\r
43 #define YYLSP_NEEDED 0\r
44 \r
45 /* If NAME_PREFIX is specified substitute the variables and functions\r
46    names.  */\r
47 #define yyparse ResParserparse\r
48 #define yylex   ResParserlex\r
49 #define yyerror ResParsererror\r
50 #define yylval  ResParserlval\r
51 #define yychar  ResParserchar\r
52 #define yydebug ResParserdebug\r
53 #define yynerrs ResParsernerrs\r
54 \r
55 \r
56 /* Tokens.  */\r
57 #ifndef YYTOKENTYPE\r
58 # define YYTOKENTYPE\r
59    /* Put the tokens into the symbol table, so that GDB and other debuggers\r
60       know about them.  */\r
61    enum yytokentype {\r
62      NAME = 258,\r
63      STRING_TOKEN = 259\r
64    };\r
65 #endif\r
66 #define NAME 258\r
67 #define STRING_TOKEN 259\r
68 \r
69 \r
70 \r
71 \r
72 /* Copy the first part of user declarations.  */\r
73 #line 8 "res.y"\r
74 \r
75 \r
76 \r
77 #include <stdio.h>\r
78 \r
79 /*              Some addn'l includes, necessary but not included by the\r
80                 bison generated code.\r
81 */\r
82 \r
83 #include <stdlib.h>\r
84 \r
85 /*              prototypes for the parser callbacks.\r
86 */\r
87 \r
88 #include "iface_q.h"\r
89 \r
90 \r
91 extern resparse_data *rpd_ptr;\r
92 extern std::vector<std::string> res_attr_vec;\r
93 extern std::vector<std::string> res_val_vec;\r
94 extern std::string res_a, res_v;\r
95 \r
96 \r
97 \r
98 #define YYDEBUG 1\r
99 \r
100 \r
101 \r
102 /* Enabling traces.  */\r
103 #ifndef YYDEBUG\r
104 # define YYDEBUG 0\r
105 #endif\r
106 \r
107 /* Enabling verbose error messages.  */\r
108 #ifdef YYERROR_VERBOSE\r
109 # undef YYERROR_VERBOSE\r
110 # define YYERROR_VERBOSE 1\r
111 #else\r
112 # define YYERROR_VERBOSE 0\r
113 #endif\r
114 \r
115 #ifndef YYSTYPE\r
116 #line 39 "res.y"\r
117 typedef union {\r
118         int intval;\r
119         double floatval;\r
120         char *strval;\r
121         int subtok;\r
122 \r
123         /*                      for FTA definition.     */\r
124 \r
125 } yystype;\r
126 /* Line 193 of /usr/local/share/bison/yacc.c.  */\r
127 #line 128 "res.tab.cc"\r
128 # define YYSTYPE yystype\r
129 # define YYSTYPE_IS_TRIVIAL 1\r
130 #endif\r
131 \r
132 #ifndef YYLTYPE\r
133 typedef struct yyltype\r
134 {\r
135   int first_line;\r
136   int first_column;\r
137   int last_line;\r
138   int last_column;\r
139 } yyltype;\r
140 # define YYLTYPE yyltype\r
141 # define YYLTYPE_IS_TRIVIAL 1\r
142 #endif\r
143 \r
144 /* Copy the second part of user declarations.  */\r
145 \r
146 \r
147 /* Line 213 of /usr/local/share/bison/yacc.c.  */\r
148 #line 149 "res.tab.cc"\r
149 \r
150 #if ! defined (yyoverflow) || YYERROR_VERBOSE\r
151 \r
152 /* The parser invokes alloca or malloc; define the necessary symbols.  */\r
153 \r
154 # if YYSTACK_USE_ALLOCA\r
155 #  define YYSTACK_ALLOC alloca\r
156 # else\r
157 #  ifndef YYSTACK_USE_ALLOCA\r
158 #   if defined (alloca) || defined (_ALLOCA_H)\r
159 #    define YYSTACK_ALLOC alloca\r
160 #   else\r
161 #    ifdef __GNUC__\r
162 #     define YYSTACK_ALLOC __builtin_alloca\r
163 #    endif\r
164 #   endif\r
165 #  endif\r
166 # endif\r
167 \r
168 # ifdef YYSTACK_ALLOC\r
169    /* Pacify GCC's `empty if-body' warning. */\r
170 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)\r
171 # else\r
172 #  if defined (__STDC__) || defined (__cplusplus)\r
173 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */\r
174 #   define YYSIZE_T size_t\r
175 #  endif\r
176 #  define YYSTACK_ALLOC malloc\r
177 #  define YYSTACK_FREE free\r
178 # endif\r
179 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */\r
180 \r
181 \r
182 #if (! defined (yyoverflow) \\r
183      && (! defined (__cplusplus) \\r
184          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))\r
185 \r
186 /* A type that is properly aligned for any stack member.  */\r
187 union yyalloc\r
188 {\r
189   short yyss;\r
190   YYSTYPE yyvs;\r
191   };\r
192 \r
193 /* The size of the maximum gap between one aligned stack and the next.  */\r
194 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)\r
195 \r
196 /* The size of an array large to enough to hold all stacks, each with\r
197    N elements.  */\r
198 # define YYSTACK_BYTES(N) \\r
199      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \\r
200       + YYSTACK_GAP_MAX)\r
201 \r
202 /* Copy COUNT objects from FROM to TO.  The source and destination do\r
203    not overlap.  */\r
204 # ifndef YYCOPY\r
205 #  if 1 < __GNUC__\r
206 #   define YYCOPY(To, From, Count) \\r
207       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))\r
208 #  else\r
209 #   define YYCOPY(To, From, Count)              \\r
210       do                                        \\r
211         {                                       \\r
212           register YYSIZE_T yyi;                \\r
213           for (yyi = 0; yyi < (Count); yyi++)   \\r
214             (To)[yyi] = (From)[yyi];    \\r
215         }                                       \\r
216       while (0)\r
217 #  endif\r
218 # endif\r
219 \r
220 /* Relocate STACK from its old location to the new one.  The\r
221    local variables YYSIZE and YYSTACKSIZE give the old and new number of\r
222    elements in the stack, and YYPTR gives the new location of the\r
223    stack.  Advance YYPTR to a properly aligned location for the next\r
224    stack.  */\r
225 # define YYSTACK_RELOCATE(Stack)                                        \\r
226     do                                                                  \\r
227       {                                                                 \\r
228         YYSIZE_T yynewbytes;                                            \\r
229         YYCOPY (&yyptr->Stack, Stack, yysize);                          \\r
230         Stack = &yyptr->Stack;                                          \\r
231         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \\r
232         yyptr += yynewbytes / sizeof (*yyptr);                          \\r
233       }                                                                 \\r
234     while (0)\r
235 \r
236 #endif\r
237 \r
238 #if defined (__STDC__) || defined (__cplusplus)\r
239    typedef signed char yysigned_char;\r
240 #else\r
241    typedef short yysigned_char;\r
242 #endif\r
243 \r
244 /* YYFINAL -- State number of the termination state. */\r
245 #define YYFINAL  6\r
246 #define YYLAST   25\r
247 \r
248 /* YYNTOKENS -- Number of terminals. */\r
249 #define YYNTOKENS  9\r
250 /* YYNNTS -- Number of nonterminals. */\r
251 #define YYNNTS  9\r
252 /* YYNRULES -- Number of rules. */\r
253 #define YYNRULES  14\r
254 /* YYNRULES -- Number of states. */\r
255 #define YYNSTATES  26\r
256 \r
257 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */\r
258 #define YYUNDEFTOK  2\r
259 #define YYMAXUTOK   259\r
260 \r
261 #define YYTRANSLATE(X) \\r
262   ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)\r
263 \r
264 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */\r
265 static const unsigned char yytranslate[] =\r
266 {\r
267        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
268        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
269        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
270        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
271        2,     2,     2,     2,     2,     2,     2,     6,     2,     2,\r
272        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
273        5,     8,     7,     2,     2,     2,     2,     2,     2,     2,\r
274        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
275        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
276        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
277        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
278        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
279        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
280        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
281        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
282        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
283        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
284        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
285        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
286        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
287        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
288        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
289        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
290        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
291        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
292        2,     2,     2,     2,     2,     2,     1,     2,     3,     4\r
293 };\r
294 \r
295 #if YYDEBUG\r
296 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in\r
297    YYRHS.  */\r
298 static const unsigned char yyprhs[] =\r
299 {\r
300        0,     0,     3,     5,     9,    12,    18,    23,    28,    30,\r
301       33,    35,    36,    38,    41\r
302 };\r
303 \r
304 /* YYRHS -- A `-1'-separated list of the rules' RHS. */\r
305 static const yysigned_char yyrhs[] =\r
306 {\r
307       10,     0,    -1,    11,    -1,    12,    14,    13,    -1,    12,\r
308       13,    -1,     5,     3,    15,     6,     7,    -1,     5,     3,\r
309       15,     7,    -1,     5,     6,     3,     7,    -1,    11,    -1,\r
310       14,    11,    -1,    16,    -1,    -1,    17,    -1,    16,    17,\r
311       -1,     3,     8,     4,    -1\r
312 };\r
313 \r
314 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */\r
315 static const unsigned char yyrline[] =\r
316 {\r
317        0,    57,    57,    60,    62,    63,    69,    73,    78,    80,\r
318       83,    85,    88,    91,    95\r
319 };\r
320 #endif\r
321 \r
322 #if YYDEBUG || YYERROR_VERBOSE\r
323 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.\r
324    First, the terminals, then, starting at YYNTOKENS, nonterminals. */\r
325 static const char *const yytname[] =\r
326 {\r
327   "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "'<'", "'/'", \r
328   "'>'", "'='", "$accept", "parse_result", "resource", "start_tag", \r
329   "end_tag", "res_list", "opt_val_list", "val_list", "val", 0\r
330 };\r
331 #endif\r
332 \r
333 # ifdef YYPRINT\r
334 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to\r
335    token YYLEX-NUM.  */\r
336 static const unsigned short yytoknum[] =\r
337 {\r
338        0,   256,   257,   258,   259,    60,    47,    62,    61\r
339 };\r
340 # endif\r
341 \r
342 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */\r
343 static const unsigned char yyr1[] =\r
344 {\r
345        0,     9,    10,    11,    11,    11,    12,    13,    14,    14,\r
346       15,    15,    16,    16,    17\r
347 };\r
348 \r
349 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */\r
350 static const unsigned char yyr2[] =\r
351 {\r
352        0,     2,     1,     3,     2,     5,     4,     4,     1,     2,\r
353        1,     0,     1,     2,     3\r
354 };\r
355 \r
356 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state\r
357    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero\r
358    means the default is an error.  */\r
359 static const unsigned char yydefact[] =\r
360 {\r
361        0,     0,     0,     2,     0,    11,     1,     0,     8,     4,\r
362        0,     0,     0,    10,    12,     0,     9,     3,     0,     0,\r
363        6,    13,     0,    14,     5,     7\r
364 };\r
365 \r
366 /* YYDEFGOTO[NTERM-NUM]. */\r
367 static const yysigned_char yydefgoto[] =\r
368 {\r
369       -1,     2,     3,     4,     9,    10,    12,    13,    14\r
370 };\r
371 \r
372 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing\r
373    STATE-NUM.  */\r
374 #define YYPACT_NINF -5\r
375 static const yysigned_char yypact[] =\r
376 {\r
377       -3,     0,     5,    -5,     4,     7,    -5,    -2,    -5,    -5,\r
378        4,     3,     1,     7,    -5,     9,    -5,    -5,    10,     6,\r
379       -5,    -5,     8,    -5,    -5,    -5\r
380 };\r
381 \r
382 /* YYPGOTO[NTERM-NUM].  */\r
383 static const yysigned_char yypgoto[] =\r
384 {\r
385       -5,    -5,    -4,    -5,    11,    -5,    -5,    -5,    12\r
386 };\r
387 \r
388 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If\r
389    positive, shift that token.  If negative, reduce the rule which\r
390    number is the opposite.  If zero, do what YYDEFACT says.\r
391    If YYTABLE_NINF, parse error.  */\r
392 #define YYTABLE_NINF -1\r
393 static const unsigned char yytable[] =\r
394 {\r
395        8,     5,     1,     5,    15,     6,    16,    19,    20,     7,\r
396       11,    18,    22,    24,    23,    25,     0,     0,     0,     0,\r
397        0,    17,     0,     0,     0,    21\r
398 };\r
399 \r
400 static const yysigned_char yycheck[] =\r
401 {\r
402        4,     3,     5,     3,     6,     0,    10,     6,     7,     5,\r
403        3,     8,     3,     7,     4,     7,    -1,    -1,    -1,    -1,\r
404       -1,    10,    -1,    -1,    -1,    13\r
405 };\r
406 \r
407 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing\r
408    symbol of state STATE-NUM.  */\r
409 static const unsigned char yystos[] =\r
410 {\r
411        0,     5,    10,    11,    12,     3,     0,     5,    11,    13,\r
412       14,     3,    15,    16,    17,     6,    11,    13,     8,     6,\r
413        7,    17,     3,     4,     7,     7\r
414 };\r
415 \r
416 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)\r
417 # define YYSIZE_T __SIZE_TYPE__\r
418 #endif\r
419 #if ! defined (YYSIZE_T) && defined (size_t)\r
420 # define YYSIZE_T size_t\r
421 #endif\r
422 #if ! defined (YYSIZE_T)\r
423 # if defined (__STDC__) || defined (__cplusplus)\r
424 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */\r
425 #  define YYSIZE_T size_t\r
426 # endif\r
427 #endif\r
428 #if ! defined (YYSIZE_T)\r
429 # define YYSIZE_T unsigned int\r
430 #endif\r
431 \r
432 #define yyerrok         (yyerrstatus = 0)\r
433 #define yyclearin       (yychar = YYEMPTY)\r
434 #define YYEMPTY         -2\r
435 #define YYEOF           0\r
436 \r
437 #define YYACCEPT        goto yyacceptlab\r
438 #define YYABORT         goto yyabortlab\r
439 #define YYERROR         goto yyerrlab1\r
440 \r
441 /* Like YYERROR except do call yyerror.  This remains here temporarily\r
442    to ease the transition to the new meaning of YYERROR, for GCC.\r
443    Once GCC version 2 has supplanted version 1, this can go.  */\r
444 \r
445 #define YYFAIL          goto yyerrlab\r
446 \r
447 #define YYRECOVERING()  (!!yyerrstatus)\r
448 \r
449 #define YYBACKUP(Token, Value)                                  \\r
450 do                                                              \\r
451   if (yychar == YYEMPTY && yylen == 1)                          \\r
452     {                                                           \\r
453       yychar = (Token);                                         \\r
454       yylval = (Value);                                         \\r
455       yychar1 = YYTRANSLATE (yychar);                           \\r
456       YYPOPSTACK;                                               \\r
457       goto yybackup;                                            \\r
458     }                                                           \\r
459   else                                                          \\r
460     {                                                           \\r
461       yyerror ("syntax error: cannot back up");                 \\r
462       YYERROR;                                                  \\r
463     }                                                           \\r
464 while (0)\r
465 \r
466 #define YYTERROR        1\r
467 #define YYERRCODE       256\r
468 \r
469 /* YYLLOC_DEFAULT -- Compute the default location (before the actions\r
470    are run).  */\r
471 \r
472 #ifndef YYLLOC_DEFAULT\r
473 # define YYLLOC_DEFAULT(Current, Rhs, N)           \\r
474   Current.first_line   = Rhs[1].first_line;      \\r
475   Current.first_column = Rhs[1].first_column;    \\r
476   Current.last_line    = Rhs[N].last_line;       \\r
477   Current.last_column  = Rhs[N].last_column;\r
478 #endif\r
479 \r
480 /* YYLEX -- calling `yylex' with the right arguments.  */\r
481 \r
482 #define YYLEX   yylex ()\r
483 \r
484 /* Enable debugging if requested.  */\r
485 #if YYDEBUG\r
486 \r
487 # ifndef YYFPRINTF\r
488 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */\r
489 #  define YYFPRINTF fprintf\r
490 # endif\r
491 \r
492 # define YYDPRINTF(Args)                        \\r
493 do {                                            \\r
494   if (yydebug)                                  \\r
495     YYFPRINTF Args;                             \\r
496 } while (0)\r
497 # define YYDSYMPRINT(Args)                      \\r
498 do {                                            \\r
499   if (yydebug)                                  \\r
500     yysymprint Args;                            \\r
501 } while (0)\r
502 /* Nonzero means print parse trace.  It is left uninitialized so that\r
503    multiple parsers can coexist.  */\r
504 int yydebug;\r
505 #else /* !YYDEBUG */\r
506 # define YYDPRINTF(Args)\r
507 # define YYDSYMPRINT(Args)\r
508 #endif /* !YYDEBUG */\r
509 \r
510 /* YYINITDEPTH -- initial size of the parser's stacks.  */\r
511 #ifndef YYINITDEPTH\r
512 # define YYINITDEPTH 200\r
513 #endif\r
514 \r
515 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only\r
516    if the built-in stack extension method is used).\r
517 \r
518    Do not make this value too large; the results are undefined if\r
519    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)\r
520    evaluated with infinite-precision integer arithmetic.  */\r
521 \r
522 #if YYMAXDEPTH == 0\r
523 # undef YYMAXDEPTH\r
524 #endif\r
525 \r
526 #ifndef YYMAXDEPTH\r
527 # define YYMAXDEPTH 10000\r
528 #endif\r
529 \r
530 \f\r
531 \r
532 #if YYERROR_VERBOSE\r
533 \r
534 # ifndef yystrlen\r
535 #  if defined (__GLIBC__) && defined (_STRING_H)\r
536 #   define yystrlen strlen\r
537 #  else\r
538 /* Return the length of YYSTR.  */\r
539 static YYSIZE_T\r
540 #   if defined (__STDC__) || defined (__cplusplus)\r
541 yystrlen (const char *yystr)\r
542 #   else\r
543 yystrlen (yystr)\r
544      const char *yystr;\r
545 #   endif\r
546 {\r
547   register const char *yys = yystr;\r
548 \r
549   while (*yys++ != '\0')\r
550     continue;\r
551 \r
552   return yys - yystr - 1;\r
553 }\r
554 #  endif\r
555 # endif\r
556 \r
557 # ifndef yystpcpy\r
558 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)\r
559 #   define yystpcpy stpcpy\r
560 #  else\r
561 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in\r
562    YYDEST.  */\r
563 static char *\r
564 #   if defined (__STDC__) || defined (__cplusplus)\r
565 yystpcpy (char *yydest, const char *yysrc)\r
566 #   else\r
567 yystpcpy (yydest, yysrc)\r
568      char *yydest;\r
569      const char *yysrc;\r
570 #   endif\r
571 {\r
572   register char *yyd = yydest;\r
573   register const char *yys = yysrc;\r
574 \r
575   while ((*yyd++ = *yys++) != '\0')\r
576     continue;\r
577 \r
578   return yyd - 1;\r
579 }\r
580 #  endif\r
581 # endif\r
582 \r
583 #endif /* !YYERROR_VERBOSE */\r
584 \r
585 \f\r
586 \r
587 #if YYDEBUG\r
588 /*-----------------------------.\r
589 | Print this symbol on YYOUT.  |\r
590 `-----------------------------*/\r
591 \r
592 static void\r
593 #if defined (__STDC__) || defined (__cplusplus)\r
594 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)\r
595 #else\r
596 yysymprint (yyout, yytype, yyvalue)\r
597     FILE* yyout;\r
598     int yytype;\r
599     YYSTYPE yyvalue;\r
600 #endif\r
601 {\r
602   /* Pacify ``unused variable'' warnings.  */\r
603   (void) yyvalue;\r
604 \r
605   if (yytype < YYNTOKENS)\r
606     {\r
607       YYFPRINTF (yyout, "token %s (", yytname[yytype]);\r
608 # ifdef YYPRINT\r
609       YYPRINT (yyout, yytoknum[yytype], yyvalue);\r
610 # endif\r
611     }\r
612   else\r
613     YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);\r
614 \r
615   switch (yytype)\r
616     {\r
617       default:\r
618         break;\r
619     }\r
620   YYFPRINTF (yyout, ")");\r
621 }\r
622 #endif /* YYDEBUG. */\r
623 \r
624 \r
625 /*-----------------------------------------------.\r
626 | Release the memory associated to this symbol.  |\r
627 `-----------------------------------------------*/\r
628 \r
629 static void\r
630 #if defined (__STDC__) || defined (__cplusplus)\r
631 yydestruct (int yytype, YYSTYPE yyvalue)\r
632 #else\r
633 yydestruct (yytype, yyvalue)\r
634     int yytype;\r
635     YYSTYPE yyvalue;\r
636 #endif\r
637 {\r
638   /* Pacify ``unused variable'' warnings.  */\r
639   (void) yyvalue;\r
640 \r
641   switch (yytype)\r
642     {\r
643       default:\r
644         break;\r
645     }\r
646 }\r
647 \r
648 \f\r
649 \r
650 /* The user can define YYPARSE_PARAM as the name of an argument to be passed\r
651    into yyparse.  The argument should have type void *.\r
652    It should actually point to an object.\r
653    Grammar actions can access the variable by casting it\r
654    to the proper pointer type.  */\r
655 \r
656 #ifdef YYPARSE_PARAM\r
657 # if defined (__STDC__) || defined (__cplusplus)\r
658 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM\r
659 #  define YYPARSE_PARAM_DECL\r
660 # else\r
661 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM\r
662 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;\r
663 # endif\r
664 #else /* !YYPARSE_PARAM */\r
665 # define YYPARSE_PARAM_ARG\r
666 # define YYPARSE_PARAM_DECL\r
667 #endif /* !YYPARSE_PARAM */\r
668 \r
669 /* Prevent warning if -Wstrict-prototypes.  */\r
670 #ifdef __GNUC__\r
671 # ifdef YYPARSE_PARAM\r
672 int yyparse (void *);\r
673 # else\r
674 int yyparse (void);\r
675 # endif\r
676 #endif\r
677 \r
678 \r
679 /* The lookahead symbol.  */\r
680 int yychar;\r
681 \r
682 /* The semantic value of the lookahead symbol.  */\r
683 YYSTYPE yylval;\r
684 \r
685 /* Number of parse errors so far.  */\r
686 int yynerrs;\r
687 \r
688 \r
689 int\r
690 yyparse (YYPARSE_PARAM_ARG)\r
691      YYPARSE_PARAM_DECL\r
692 {\r
693   \r
694   register int yystate;\r
695   register int yyn;\r
696   int yyresult;\r
697   /* Number of tokens to shift before error messages enabled.  */\r
698   int yyerrstatus;\r
699   /* Lookahead token as an internal (translated) token number.  */\r
700   int yychar1 = 0;\r
701 \r
702   /* Three stacks and their tools:\r
703      `yyss': related to states,\r
704      `yyvs': related to semantic values,\r
705      `yyls': related to locations.\r
706 \r
707      Refer to the stacks thru separate pointers, to allow yyoverflow\r
708      to reallocate them elsewhere.  */\r
709 \r
710   /* The state stack.  */\r
711   short yyssa[YYINITDEPTH];\r
712   short *yyss = yyssa;\r
713   register short *yyssp;\r
714 \r
715   /* The semantic value stack.  */\r
716   YYSTYPE yyvsa[YYINITDEPTH];\r
717   YYSTYPE *yyvs = yyvsa;\r
718   register YYSTYPE *yyvsp;\r
719 \r
720 \r
721 \r
722 #define YYPOPSTACK   (yyvsp--, yyssp--)\r
723 \r
724   YYSIZE_T yystacksize = YYINITDEPTH;\r
725 \r
726   /* The variables used to return semantic value and location from the\r
727      action routines.  */\r
728   YYSTYPE yyval;\r
729 \r
730 \r
731   /* When reducing, the number of symbols on the RHS of the reduced\r
732      rule.  */\r
733   int yylen;\r
734 \r
735   YYDPRINTF ((stderr, "Starting parse\n"));\r
736 \r
737   yystate = 0;\r
738   yyerrstatus = 0;\r
739   yynerrs = 0;\r
740   yychar = YYEMPTY;             /* Cause a token to be read.  */\r
741 \r
742   /* Initialize stack pointers.\r
743      Waste one element of value and location stack\r
744      so that they stay on the same level as the state stack.\r
745      The wasted elements are never initialized.  */\r
746 \r
747   yyssp = yyss;\r
748   yyvsp = yyvs;\r
749 \r
750   goto yysetstate;\r
751 \r
752 /*------------------------------------------------------------.\r
753 | yynewstate -- Push a new state, which is found in yystate.  |\r
754 `------------------------------------------------------------*/\r
755  yynewstate:\r
756   /* In all cases, when you get here, the value and location stacks\r
757      have just been pushed. so pushing a state here evens the stacks.\r
758      */\r
759   yyssp++;\r
760 \r
761  yysetstate:\r
762   *yyssp = yystate;\r
763 \r
764   if (yyssp >= yyss + yystacksize - 1)\r
765     {\r
766       /* Get the current used size of the three stacks, in elements.  */\r
767       YYSIZE_T yysize = yyssp - yyss + 1;\r
768 \r
769 #ifdef yyoverflow\r
770       {\r
771         /* Give user a chance to reallocate the stack. Use copies of\r
772            these so that the &'s don't force the real ones into\r
773            memory.  */\r
774         YYSTYPE *yyvs1 = yyvs;\r
775         short *yyss1 = yyss;\r
776 \r
777 \r
778         /* Each stack pointer address is followed by the size of the\r
779            data in use in that stack, in bytes.  This used to be a\r
780            conditional around just the two extra args, but that might\r
781            be undefined if yyoverflow is a macro.  */\r
782         yyoverflow ("parser stack overflow",\r
783                     &yyss1, yysize * sizeof (*yyssp),\r
784                     &yyvs1, yysize * sizeof (*yyvsp),\r
785 \r
786                     &yystacksize);\r
787 \r
788         yyss = yyss1;\r
789         yyvs = yyvs1;\r
790       }\r
791 #else /* no yyoverflow */\r
792 # ifndef YYSTACK_RELOCATE\r
793       goto yyoverflowlab;\r
794 # else\r
795       /* Extend the stack our own way.  */\r
796       if (yystacksize >= YYMAXDEPTH)\r
797         goto yyoverflowlab;\r
798       yystacksize *= 2;\r
799       if (yystacksize > YYMAXDEPTH)\r
800         yystacksize = YYMAXDEPTH;\r
801 \r
802       {\r
803         short *yyss1 = yyss;\r
804         union yyalloc *yyptr =\r
805           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));\r
806         if (! yyptr)\r
807           goto yyoverflowlab;\r
808         YYSTACK_RELOCATE (yyss);\r
809         YYSTACK_RELOCATE (yyvs);\r
810 \r
811 #  undef YYSTACK_RELOCATE\r
812         if (yyss1 != yyssa)\r
813           YYSTACK_FREE (yyss1);\r
814       }\r
815 # endif\r
816 #endif /* no yyoverflow */\r
817 \r
818       yyssp = yyss + yysize - 1;\r
819       yyvsp = yyvs + yysize - 1;\r
820 \r
821 \r
822       YYDPRINTF ((stderr, "Stack size increased to %lu\n",\r
823                   (unsigned long int) yystacksize));\r
824 \r
825       if (yyssp >= yyss + yystacksize - 1)\r
826         YYABORT;\r
827     }\r
828 \r
829   YYDPRINTF ((stderr, "Entering state %d\n", yystate));\r
830 \r
831   goto yybackup;\r
832 \r
833 /*-----------.\r
834 | yybackup.  |\r
835 `-----------*/\r
836 yybackup:\r
837 \r
838 /* Do appropriate processing given the current state.  */\r
839 /* Read a lookahead token if we need one and don't already have one.  */\r
840 /* yyresume: */\r
841 \r
842   /* First try to decide what to do without reference to lookahead token.  */\r
843 \r
844   yyn = yypact[yystate];\r
845   if (yyn == YYPACT_NINF)\r
846     goto yydefault;\r
847 \r
848   /* Not known => get a lookahead token if don't already have one.  */\r
849 \r
850   /* yychar is either YYEMPTY or YYEOF\r
851      or a valid token in external form.  */\r
852 \r
853   if (yychar == YYEMPTY)\r
854     {\r
855       YYDPRINTF ((stderr, "Reading a token: "));\r
856       yychar = YYLEX;\r
857     }\r
858 \r
859   /* Convert token to internal form (in yychar1) for indexing tables with.  */\r
860 \r
861   if (yychar <= 0)              /* This means end of input.  */\r
862     {\r
863       yychar1 = 0;\r
864       yychar = YYEOF;           /* Don't call YYLEX any more.  */\r
865 \r
866       YYDPRINTF ((stderr, "Now at end of input.\n"));\r
867     }\r
868   else\r
869     {\r
870       yychar1 = YYTRANSLATE (yychar);\r
871 \r
872       /* We have to keep this `#if YYDEBUG', since we use variables\r
873          which are defined only if `YYDEBUG' is set.  */\r
874       YYDPRINTF ((stderr, "Next token is "));\r
875       YYDSYMPRINT ((stderr, yychar1, yylval));\r
876       YYDPRINTF ((stderr, "\n"));\r
877     }\r
878 \r
879   /* If the proper action on seeing token YYCHAR1 is to reduce or to\r
880      detect an error, take that action.  */\r
881   yyn += yychar1;\r
882   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)\r
883     goto yydefault;\r
884   yyn = yytable[yyn];\r
885   if (yyn <= 0)\r
886     {\r
887       if (yyn == 0 || yyn == YYTABLE_NINF)\r
888         goto yyerrlab;\r
889       yyn = -yyn;\r
890       goto yyreduce;\r
891     }\r
892 \r
893   if (yyn == YYFINAL)\r
894     YYACCEPT;\r
895 \r
896   /* Shift the lookahead token.  */\r
897   YYDPRINTF ((stderr, "Shifting token %d (%s), ",\r
898               yychar, yytname[yychar1]));\r
899 \r
900   /* Discard the token being shifted unless it is eof.  */\r
901   if (yychar != YYEOF)\r
902     yychar = YYEMPTY;\r
903 \r
904   *++yyvsp = yylval;\r
905 \r
906 \r
907   /* Count tokens shifted since error; after three, turn off error\r
908      status.  */\r
909   if (yyerrstatus)\r
910     yyerrstatus--;\r
911 \r
912   yystate = yyn;\r
913   goto yynewstate;\r
914 \r
915 \r
916 /*-----------------------------------------------------------.\r
917 | yydefault -- do the default action for the current state.  |\r
918 `-----------------------------------------------------------*/\r
919 yydefault:\r
920   yyn = yydefact[yystate];\r
921   if (yyn == 0)\r
922     goto yyerrlab;\r
923   goto yyreduce;\r
924 \r
925 \r
926 /*-----------------------------.\r
927 | yyreduce -- Do a reduction.  |\r
928 `-----------------------------*/\r
929 yyreduce:\r
930   /* yyn is the number of a rule to reduce with.  */\r
931   yylen = yyr2[yyn];\r
932 \r
933   /* If YYLEN is nonzero, implement the default value of the action:\r
934      `$$ = $1'.\r
935 \r
936      Otherwise, the following line sets YYVAL to garbage.\r
937      This behavior is undocumented and Bison\r
938      users should not rely upon it.  Assigning to YYVAL\r
939      unconditionally makes the parser a bit smaller, and it avoids a\r
940      GCC warning that YYVAL may be used uninitialized.  */\r
941   yyval = yyvsp[1-yylen];\r
942 \r
943 \r
944 \r
945 #if YYDEBUG\r
946   /* We have to keep this `#if YYDEBUG', since we use variables which\r
947      are defined only if `YYDEBUG' is set.  */\r
948   if (yydebug)\r
949     {\r
950       int yyi;\r
951 \r
952       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",\r
953                  yyn - 1, yyrline[yyn]);\r
954 \r
955       /* Print the symbols being reduced, and their result.  */\r
956       for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)\r
957         YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);\r
958       YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);\r
959     }\r
960 #endif\r
961   switch (yyn)\r
962     {\r
963         case 5:\r
964 #line 64 "res.y"\r
965     {startElement(rpd_ptr, yyvsp[-3].strval, res_attr_vec, res_val_vec);\r
966                 endElement(rpd_ptr, yyvsp[-3].strval);\r
967                 }\r
968     break;\r
969 \r
970   case 6:\r
971 #line 70 "res.y"\r
972     {startElement(rpd_ptr, yyvsp[-2].strval, res_attr_vec, res_val_vec);}\r
973     break;\r
974 \r
975   case 7:\r
976 #line 74 "res.y"\r
977     {endElement(rpd_ptr, yyvsp[-1].strval);}\r
978     break;\r
979 \r
980   case 11:\r
981 #line 85 "res.y"\r
982     {res_attr_vec.clear(); res_val_vec.clear();}\r
983     break;\r
984 \r
985   case 12:\r
986 #line 89 "res.y"\r
987     {res_attr_vec.clear();  res_attr_vec.push_back(res_a);\r
988                          res_val_vec.clear(); res_val_vec.push_back(res_v); }\r
989     break;\r
990 \r
991   case 13:\r
992 #line 91 "res.y"\r
993     {res_attr_vec.push_back(res_a);\r
994                                         res_val_vec.push_back(res_v); }\r
995     break;\r
996 \r
997   case 14:\r
998 #line 96 "res.y"\r
999     {res_a = yyvsp[-2].strval; res_v = yyvsp[0].strval;}\r
1000     break;\r
1001 \r
1002 \r
1003     }\r
1004 \r
1005 /* Line 1016 of /usr/local/share/bison/yacc.c.  */\r
1006 #line 1007 "res.tab.cc"\r
1007 \f\r
1008   yyvsp -= yylen;\r
1009   yyssp -= yylen;\r
1010 \r
1011 \r
1012 #if YYDEBUG\r
1013   if (yydebug)\r
1014     {\r
1015       short *yyssp1 = yyss - 1;\r
1016       YYFPRINTF (stderr, "state stack now");\r
1017       while (yyssp1 != yyssp)\r
1018         YYFPRINTF (stderr, " %d", *++yyssp1);\r
1019       YYFPRINTF (stderr, "\n");\r
1020     }\r
1021 #endif\r
1022 \r
1023   *++yyvsp = yyval;\r
1024 \r
1025 \r
1026   /* Now `shift' the result of the reduction.  Determine what state\r
1027      that goes to, based on the state we popped back to and the rule\r
1028      number reduced by.  */\r
1029 \r
1030   yyn = yyr1[yyn];\r
1031 \r
1032   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;\r
1033   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)\r
1034     yystate = yytable[yystate];\r
1035   else\r
1036     yystate = yydefgoto[yyn - YYNTOKENS];\r
1037 \r
1038   goto yynewstate;\r
1039 \r
1040 \r
1041 /*------------------------------------.\r
1042 | yyerrlab -- here on detecting error |\r
1043 `------------------------------------*/\r
1044 yyerrlab:\r
1045   /* If not already recovering from an error, report this error.  */\r
1046   if (!yyerrstatus)\r
1047     {\r
1048       ++yynerrs;\r
1049 #if YYERROR_VERBOSE\r
1050       yyn = yypact[yystate];\r
1051 \r
1052       if (YYPACT_NINF < yyn && yyn < YYLAST)\r
1053         {\r
1054           YYSIZE_T yysize = 0;\r
1055           int yytype = YYTRANSLATE (yychar);\r
1056           char *yymsg;\r
1057           int yyx, yycount;\r
1058 \r
1059           yycount = 0;\r
1060           /* Start YYX at -YYN if negative to avoid negative indexes in\r
1061              YYCHECK.  */\r
1062           for (yyx = yyn < 0 ? -yyn : 0;\r
1063                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)\r
1064             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)\r
1065               yysize += yystrlen (yytname[yyx]) + 15, yycount++;\r
1066           yysize += yystrlen ("parse error, unexpected ") + 1;\r
1067           yysize += yystrlen (yytname[yytype]);\r
1068           yymsg = (char *) YYSTACK_ALLOC (yysize);\r
1069           if (yymsg != 0)\r
1070             {\r
1071               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");\r
1072               yyp = yystpcpy (yyp, yytname[yytype]);\r
1073 \r
1074               if (yycount < 5)\r
1075                 {\r
1076                   yycount = 0;\r
1077                   for (yyx = yyn < 0 ? -yyn : 0;\r
1078                        yyx < (int) (sizeof (yytname) / sizeof (char *));\r
1079                        yyx++)\r
1080                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)\r
1081                       {\r
1082                         const char *yyq = ! yycount ? ", expecting " : " or ";\r
1083                         yyp = yystpcpy (yyp, yyq);\r
1084                         yyp = yystpcpy (yyp, yytname[yyx]);\r
1085                         yycount++;\r
1086                       }\r
1087                 }\r
1088               yyerror (yymsg);\r
1089               YYSTACK_FREE (yymsg);\r
1090             }\r
1091           else\r
1092             yyerror ("parse error; also virtual memory exhausted");\r
1093         }\r
1094       else\r
1095 #endif /* YYERROR_VERBOSE */\r
1096         yyerror ("parse error");\r
1097     }\r
1098   goto yyerrlab1;\r
1099 \r
1100 \r
1101 /*----------------------------------------------------.\r
1102 | yyerrlab1 -- error raised explicitly by an action.  |\r
1103 `----------------------------------------------------*/\r
1104 yyerrlab1:\r
1105   if (yyerrstatus == 3)\r
1106     {\r
1107       /* If just tried and failed to reuse lookahead token after an\r
1108          error, discard it.  */\r
1109 \r
1110       /* Return failure if at end of input.  */\r
1111       if (yychar == YYEOF)\r
1112         {\r
1113           /* Pop the error token.  */\r
1114           YYPOPSTACK;\r
1115           /* Pop the rest of the stack.  */\r
1116           while (yyssp > yyss)\r
1117             {\r
1118               YYDPRINTF ((stderr, "Error: popping "));\r
1119               YYDSYMPRINT ((stderr,\r
1120                             yystos[*yyssp],\r
1121                             *yyvsp));\r
1122               YYDPRINTF ((stderr, "\n"));\r
1123               yydestruct (yystos[*yyssp], *yyvsp);\r
1124               YYPOPSTACK;\r
1125             }\r
1126           YYABORT;\r
1127         }\r
1128 \r
1129       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",\r
1130                   yychar, yytname[yychar1]));\r
1131       yydestruct (yychar1, yylval);\r
1132       yychar = YYEMPTY;\r
1133     }\r
1134 \r
1135   /* Else will try to reuse lookahead token after shifting the error\r
1136      token.  */\r
1137 \r
1138   yyerrstatus = 3;      /* Each real token shifted decrements this.  */\r
1139 \r
1140   for (;;)\r
1141     {\r
1142       yyn = yypact[yystate];\r
1143       if (yyn != YYPACT_NINF)\r
1144         {\r
1145           yyn += YYTERROR;\r
1146           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)\r
1147             {\r
1148               yyn = yytable[yyn];\r
1149               if (0 < yyn)\r
1150                 break;\r
1151             }\r
1152         }\r
1153 \r
1154       /* Pop the current state because it cannot handle the error token.  */\r
1155       if (yyssp == yyss)\r
1156         YYABORT;\r
1157 \r
1158       YYDPRINTF ((stderr, "Error: popping "));\r
1159       YYDSYMPRINT ((stderr,\r
1160                     yystos[*yyssp], *yyvsp));\r
1161       YYDPRINTF ((stderr, "\n"));\r
1162 \r
1163       yydestruct (yystos[yystate], *yyvsp);\r
1164       yyvsp--;\r
1165       yystate = *--yyssp;\r
1166 \r
1167 \r
1168 #if YYDEBUG\r
1169       if (yydebug)\r
1170         {\r
1171           short *yyssp1 = yyss - 1;\r
1172           YYFPRINTF (stderr, "Error: state stack now");\r
1173           while (yyssp1 != yyssp)\r
1174             YYFPRINTF (stderr, " %d", *++yyssp1);\r
1175           YYFPRINTF (stderr, "\n");\r
1176         }\r
1177 #endif\r
1178     }\r
1179 \r
1180   if (yyn == YYFINAL)\r
1181     YYACCEPT;\r
1182 \r
1183   YYDPRINTF ((stderr, "Shifting error token, "));\r
1184 \r
1185   *++yyvsp = yylval;\r
1186 \r
1187 \r
1188   yystate = yyn;\r
1189   goto yynewstate;\r
1190 \r
1191 \r
1192 /*-------------------------------------.\r
1193 | yyacceptlab -- YYACCEPT comes here.  |\r
1194 `-------------------------------------*/\r
1195 yyacceptlab:\r
1196   yyresult = 0;\r
1197   goto yyreturn;\r
1198 \r
1199 /*-----------------------------------.\r
1200 | yyabortlab -- YYABORT comes here.  |\r
1201 `-----------------------------------*/\r
1202 yyabortlab:\r
1203   yyresult = 1;\r
1204   goto yyreturn;\r
1205 \r
1206 #ifndef yyoverflow\r
1207 /*----------------------------------------------.\r
1208 | yyoverflowlab -- parser overflow comes here.  |\r
1209 `----------------------------------------------*/\r
1210 yyoverflowlab:\r
1211   yyerror ("parser stack overflow");\r
1212   yyresult = 2;\r
1213   /* Fall through.  */\r
1214 #endif\r
1215 \r
1216 yyreturn:\r
1217 #ifndef yyoverflow\r
1218   if (yyss != yyssa)\r
1219     YYSTACK_FREE (yyss);\r
1220 #endif\r
1221   return yyresult;\r
1222 }\r
1223 \r
1224 \r
1225 #line 103 "res.y"\r
1226 \r
1227 \r
1228 \r