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