1 /* A Bison parser, made from res.y, by GNU bison 1.75. */
\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
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
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
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
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
26 /* Written by Richard Stallman by simplifying the original so called
\r
27 ``semantic'' parser. */
\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
36 /* Identify Bison output. */
\r
42 /* Using locations. */
\r
43 #define YYLSP_NEEDED 0
\r
45 /* If NAME_PREFIX is specified substitute the variables and functions
\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
58 # define YYTOKENTYPE
\r
59 /* Put the tokens into the symbol table, so that GDB and other debuggers
\r
67 #define STRING_TOKEN 259
\r
72 /* Copy the first part of user declarations. */
\r
79 /* Some addn'l includes, necessary but not included by the
\r
80 bison generated code.
\r
85 /* prototypes for the parser callbacks.
\r
88 #include "iface_q.h"
\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
102 /* Enabling traces. */
\r
107 /* Enabling verbose error messages. */
\r
108 #ifdef YYERROR_VERBOSE
\r
109 # undef YYERROR_VERBOSE
\r
110 # define YYERROR_VERBOSE 1
\r
112 # define YYERROR_VERBOSE 0
\r
123 /* for FTA definition. */
\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
133 typedef struct yyltype
\r
140 # define YYLTYPE yyltype
\r
141 # define YYLTYPE_IS_TRIVIAL 1
\r
144 /* Copy the second part of user declarations. */
\r
147 /* Line 213 of /usr/local/share/bison/yacc.c. */
\r
148 #line 149 "res.tab.cc"
\r
150 #if ! defined (yyoverflow) || YYERROR_VERBOSE
\r
152 /* The parser invokes alloca or malloc; define the necessary symbols. */
\r
154 # if YYSTACK_USE_ALLOCA
\r
155 # define YYSTACK_ALLOC alloca
\r
157 # ifndef YYSTACK_USE_ALLOCA
\r
158 # if defined (alloca) || defined (_ALLOCA_H)
\r
159 # define YYSTACK_ALLOC alloca
\r
162 # define YYSTACK_ALLOC __builtin_alloca
\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
172 # if defined (__STDC__) || defined (__cplusplus)
\r
173 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
\r
174 # define YYSIZE_T size_t
\r
176 # define YYSTACK_ALLOC malloc
\r
177 # define YYSTACK_FREE free
\r
179 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
\r
182 #if (! defined (yyoverflow) \
\r
183 && (! defined (__cplusplus) \
\r
184 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
\r
186 /* A type that is properly aligned for any stack member. */
\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
196 /* The size of an array large to enough to hold all stacks, each with
\r
198 # define YYSTACK_BYTES(N) \
\r
199 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
\r
202 /* Copy COUNT objects from FROM to TO. The source and destination do
\r
206 # define YYCOPY(To, From, Count) \
\r
207 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
\r
209 # define YYCOPY(To, From, Count) \
\r
212 register YYSIZE_T yyi; \
\r
213 for (yyi = 0; yyi < (Count); yyi++) \
\r
214 (To)[yyi] = (From)[yyi]; \
\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
225 # define YYSTACK_RELOCATE(Stack) \
\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
238 #if defined (__STDC__) || defined (__cplusplus)
\r
239 typedef signed char yysigned_char;
\r
241 typedef short yysigned_char;
\r
244 /* YYFINAL -- State number of the termination state. */
\r
248 /* YYNTOKENS -- Number of terminals. */
\r
249 #define YYNTOKENS 9
\r
250 /* YYNNTS -- Number of nonterminals. */
\r
252 /* YYNRULES -- Number of rules. */
\r
253 #define YYNRULES 14
\r
254 /* YYNRULES -- Number of states. */
\r
255 #define YYNSTATES 26
\r
257 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
\r
258 #define YYUNDEFTOK 2
\r
259 #define YYMAXUTOK 259
\r
261 #define YYTRANSLATE(X) \
\r
262 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
\r
264 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
\r
265 static const unsigned char yytranslate[] =
\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
296 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
\r
298 static const unsigned char yyprhs[] =
\r
300 0, 0, 3, 5, 9, 12, 18, 23, 28, 30,
\r
304 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
\r
305 static const yysigned_char yyrhs[] =
\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
314 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
\r
315 static const unsigned char yyrline[] =
\r
317 0, 57, 57, 60, 62, 63, 69, 73, 78, 80,
\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
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
334 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
\r
335 token YYLEX-NUM. */
\r
336 static const unsigned short yytoknum[] =
\r
338 0, 256, 257, 258, 259, 60, 47, 62, 61
\r
342 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
\r
343 static const unsigned char yyr1[] =
\r
345 0, 9, 10, 11, 11, 11, 12, 13, 14, 14,
\r
349 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
\r
350 static const unsigned char yyr2[] =
\r
352 0, 2, 1, 3, 2, 5, 4, 4, 1, 2,
\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
361 0, 0, 0, 2, 0, 11, 1, 0, 8, 4,
\r
362 0, 0, 0, 10, 12, 0, 9, 3, 0, 0,
\r
366 /* YYDEFGOTO[NTERM-NUM]. */
\r
367 static const yysigned_char yydefgoto[] =
\r
369 -1, 2, 3, 4, 9, 10, 12, 13, 14
\r
372 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
\r
374 #define YYPACT_NINF -5
\r
375 static const yysigned_char yypact[] =
\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
382 /* YYPGOTO[NTERM-NUM]. */
\r
383 static const yysigned_char yypgoto[] =
\r
385 -5, -5, -4, -5, 11, -5, -5, -5, 12
\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
395 8, 5, 1, 5, 15, 6, 16, 19, 20, 7,
\r
396 11, 18, 22, 24, 23, 25, 0, 0, 0, 0,
\r
400 static const yysigned_char yycheck[] =
\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
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
411 0, 5, 10, 11, 12, 3, 0, 5, 11, 13,
\r
412 14, 3, 15, 16, 17, 6, 11, 13, 8, 6,
\r
416 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
\r
417 # define YYSIZE_T __SIZE_TYPE__
\r
419 #if ! defined (YYSIZE_T) && defined (size_t)
\r
420 # define YYSIZE_T size_t
\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
428 #if ! defined (YYSIZE_T)
\r
429 # define YYSIZE_T unsigned int
\r
432 #define yyerrok (yyerrstatus = 0)
\r
433 #define yyclearin (yychar = YYEMPTY)
\r
437 #define YYACCEPT goto yyacceptlab
\r
438 #define YYABORT goto yyabortlab
\r
439 #define YYERROR goto yyerrlab1
\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
445 #define YYFAIL goto yyerrlab
\r
447 #define YYRECOVERING() (!!yyerrstatus)
\r
449 #define YYBACKUP(Token, Value) \
\r
451 if (yychar == YYEMPTY && yylen == 1) \
\r
453 yychar = (Token); \
\r
454 yylval = (Value); \
\r
455 yychar1 = YYTRANSLATE (yychar); \
\r
461 yyerror ("syntax error: cannot back up"); \
\r
467 #define YYERRCODE 256
\r
469 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
\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
480 /* YYLEX -- calling `yylex' with the right arguments. */
\r
482 #define YYLEX yylex ()
\r
484 /* Enable debugging if requested. */
\r
488 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
\r
489 # define YYFPRINTF fprintf
\r
492 # define YYDPRINTF(Args) \
\r
497 # define YYDSYMPRINT(Args) \
\r
502 /* Nonzero means print parse trace. It is left uninitialized so that
\r
503 multiple parsers can coexist. */
\r
505 #else /* !YYDEBUG */
\r
506 # define YYDPRINTF(Args)
\r
507 # define YYDSYMPRINT(Args)
\r
508 #endif /* !YYDEBUG */
\r
510 /* YYINITDEPTH -- initial size of the parser's stacks. */
\r
511 #ifndef YYINITDEPTH
\r
512 # define YYINITDEPTH 200
\r
515 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
\r
516 if the built-in stack extension method is used).
\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
522 #if YYMAXDEPTH == 0
\r
527 # define YYMAXDEPTH 10000
\r
532 #if YYERROR_VERBOSE
\r
535 # if defined (__GLIBC__) && defined (_STRING_H)
\r
536 # define yystrlen strlen
\r
538 /* Return the length of YYSTR. */
\r
540 # if defined (__STDC__) || defined (__cplusplus)
\r
541 yystrlen (const char *yystr)
\r
547 register const char *yys = yystr;
\r
549 while (*yys++ != '\0')
\r
552 return yys - yystr - 1;
\r
558 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
\r
559 # define yystpcpy stpcpy
\r
561 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
\r
564 # if defined (__STDC__) || defined (__cplusplus)
\r
565 yystpcpy (char *yydest, const char *yysrc)
\r
567 yystpcpy (yydest, yysrc)
\r
572 register char *yyd = yydest;
\r
573 register const char *yys = yysrc;
\r
575 while ((*yyd++ = *yys++) != '\0')
\r
583 #endif /* !YYERROR_VERBOSE */
\r
588 /*-----------------------------.
\r
589 | Print this symbol on YYOUT. |
\r
590 `-----------------------------*/
\r
593 #if defined (__STDC__) || defined (__cplusplus)
\r
594 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
\r
596 yysymprint (yyout, yytype, yyvalue)
\r
602 /* Pacify ``unused variable'' warnings. */
\r
605 if (yytype < YYNTOKENS)
\r
607 YYFPRINTF (yyout, "token %s (", yytname[yytype]);
\r
609 YYPRINT (yyout, yytoknum[yytype], yyvalue);
\r
613 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
\r
620 YYFPRINTF (yyout, ")");
\r
622 #endif /* YYDEBUG. */
\r
625 /*-----------------------------------------------.
\r
626 | Release the memory associated to this symbol. |
\r
627 `-----------------------------------------------*/
\r
630 #if defined (__STDC__) || defined (__cplusplus)
\r
631 yydestruct (int yytype, YYSTYPE yyvalue)
\r
633 yydestruct (yytype, yyvalue)
\r
638 /* Pacify ``unused variable'' warnings. */
\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
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
661 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
\r
662 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
\r
664 #else /* !YYPARSE_PARAM */
\r
665 # define YYPARSE_PARAM_ARG
\r
666 # define YYPARSE_PARAM_DECL
\r
667 #endif /* !YYPARSE_PARAM */
\r
669 /* Prevent warning if -Wstrict-prototypes. */
\r
671 # ifdef YYPARSE_PARAM
\r
672 int yyparse (void *);
\r
674 int yyparse (void);
\r
679 /* The lookahead symbol. */
\r
682 /* The semantic value of the lookahead symbol. */
\r
685 /* Number of parse errors so far. */
\r
690 yyparse (YYPARSE_PARAM_ARG)
\r
694 register int yystate;
\r
697 /* Number of tokens to shift before error messages enabled. */
\r
699 /* Lookahead token as an internal (translated) token number. */
\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
707 Refer to the stacks thru separate pointers, to allow yyoverflow
\r
708 to reallocate them elsewhere. */
\r
710 /* The state stack. */
\r
711 short yyssa[YYINITDEPTH];
\r
712 short *yyss = yyssa;
\r
713 register short *yyssp;
\r
715 /* The semantic value stack. */
\r
716 YYSTYPE yyvsa[YYINITDEPTH];
\r
717 YYSTYPE *yyvs = yyvsa;
\r
718 register YYSTYPE *yyvsp;
\r
722 #define YYPOPSTACK (yyvsp--, yyssp--)
\r
724 YYSIZE_T yystacksize = YYINITDEPTH;
\r
726 /* The variables used to return semantic value and location from the
\r
727 action routines. */
\r
731 /* When reducing, the number of symbols on the RHS of the reduced
\r
735 YYDPRINTF ((stderr, "Starting parse\n"));
\r
740 yychar = YYEMPTY; /* Cause a token to be read. */
\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
752 /*------------------------------------------------------------.
\r
753 | yynewstate -- Push a new state, which is found in yystate. |
\r
754 `------------------------------------------------------------*/
\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
764 if (yyssp >= yyss + yystacksize - 1)
\r
766 /* Get the current used size of the three stacks, in elements. */
\r
767 YYSIZE_T yysize = yyssp - yyss + 1;
\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
774 YYSTYPE *yyvs1 = yyvs;
\r
775 short *yyss1 = yyss;
\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
791 #else /* no yyoverflow */
\r
792 # ifndef YYSTACK_RELOCATE
\r
793 goto yyoverflowlab;
\r
795 /* Extend the stack our own way. */
\r
796 if (yystacksize >= YYMAXDEPTH)
\r
797 goto yyoverflowlab;
\r
799 if (yystacksize > YYMAXDEPTH)
\r
800 yystacksize = YYMAXDEPTH;
\r
803 short *yyss1 = yyss;
\r
804 union yyalloc *yyptr =
\r
805 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
\r
807 goto yyoverflowlab;
\r
808 YYSTACK_RELOCATE (yyss);
\r
809 YYSTACK_RELOCATE (yyvs);
\r
811 # undef YYSTACK_RELOCATE
\r
812 if (yyss1 != yyssa)
\r
813 YYSTACK_FREE (yyss1);
\r
816 #endif /* no yyoverflow */
\r
818 yyssp = yyss + yysize - 1;
\r
819 yyvsp = yyvs + yysize - 1;
\r
822 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
\r
823 (unsigned long int) yystacksize));
\r
825 if (yyssp >= yyss + yystacksize - 1)
\r
829 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
\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
842 /* First try to decide what to do without reference to lookahead token. */
\r
844 yyn = yypact[yystate];
\r
845 if (yyn == YYPACT_NINF)
\r
848 /* Not known => get a lookahead token if don't already have one. */
\r
850 /* yychar is either YYEMPTY or YYEOF
\r
851 or a valid token in external form. */
\r
853 if (yychar == YYEMPTY)
\r
855 YYDPRINTF ((stderr, "Reading a token: "));
\r
859 /* Convert token to internal form (in yychar1) for indexing tables with. */
\r
861 if (yychar <= 0) /* This means end of input. */
\r
864 yychar = YYEOF; /* Don't call YYLEX any more. */
\r
866 YYDPRINTF ((stderr, "Now at end of input.\n"));
\r
870 yychar1 = YYTRANSLATE (yychar);
\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
879 /* If the proper action on seeing token YYCHAR1 is to reduce or to
\r
880 detect an error, take that action. */
\r
882 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
\r
884 yyn = yytable[yyn];
\r
887 if (yyn == 0 || yyn == YYTABLE_NINF)
\r
893 if (yyn == YYFINAL)
\r
896 /* Shift the lookahead token. */
\r
897 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
\r
898 yychar, yytname[yychar1]));
\r
900 /* Discard the token being shifted unless it is eof. */
\r
901 if (yychar != YYEOF)
\r
907 /* Count tokens shifted since error; after three, turn off error
\r
916 /*-----------------------------------------------------------.
\r
917 | yydefault -- do the default action for the current state. |
\r
918 `-----------------------------------------------------------*/
\r
920 yyn = yydefact[yystate];
\r
926 /*-----------------------------.
\r
927 | yyreduce -- Do a reduction. |
\r
928 `-----------------------------*/
\r
930 /* yyn is the number of a rule to reduce with. */
\r
933 /* If YYLEN is nonzero, implement the default value of the action:
\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
946 /* We have to keep this `#if YYDEBUG', since we use variables which
\r
947 are defined only if `YYDEBUG' is set. */
\r
952 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
\r
953 yyn - 1, yyrline[yyn]);
\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
965 {startElement(rpd_ptr, yyvsp[-3].strval, res_attr_vec, res_val_vec);
\r
966 endElement(rpd_ptr, yyvsp[-3].strval);
\r
972 {startElement(rpd_ptr, yyvsp[-2].strval, res_attr_vec, res_val_vec);}
\r
977 {endElement(rpd_ptr, yyvsp[-1].strval);}
\r
982 {res_attr_vec.clear(); res_val_vec.clear();}
\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
993 {res_attr_vec.push_back(res_a);
\r
994 res_val_vec.push_back(res_v); }
\r
999 {res_a = yyvsp[-2].strval; res_v = yyvsp[0].strval;}
\r
1005 /* Line 1016 of /usr/local/share/bison/yacc.c. */
\r
1006 #line 1007 "res.tab.cc"
\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
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
1032 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
\r
1033 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
\r
1034 yystate = yytable[yystate];
\r
1036 yystate = yydefgoto[yyn - YYNTOKENS];
\r
1041 /*------------------------------------.
\r
1042 | yyerrlab -- here on detecting error |
\r
1043 `------------------------------------*/
\r
1045 /* If not already recovering from an error, report this error. */
\r
1049 #if YYERROR_VERBOSE
\r
1050 yyn = yypact[yystate];
\r
1052 if (YYPACT_NINF < yyn && yyn < YYLAST)
\r
1054 YYSIZE_T yysize = 0;
\r
1055 int yytype = YYTRANSLATE (yychar);
\r
1060 /* Start YYX at -YYN if negative to avoid negative indexes in
\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
1071 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
\r
1072 yyp = yystpcpy (yyp, yytname[yytype]);
\r
1077 for (yyx = yyn < 0 ? -yyn : 0;
\r
1078 yyx < (int) (sizeof (yytname) / sizeof (char *));
\r
1080 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
\r
1082 const char *yyq = ! yycount ? ", expecting " : " or ";
\r
1083 yyp = yystpcpy (yyp, yyq);
\r
1084 yyp = yystpcpy (yyp, yytname[yyx]);
\r
1089 YYSTACK_FREE (yymsg);
\r
1092 yyerror ("parse error; also virtual memory exhausted");
\r
1095 #endif /* YYERROR_VERBOSE */
\r
1096 yyerror ("parse error");
\r
1101 /*----------------------------------------------------.
\r
1102 | yyerrlab1 -- error raised explicitly by an action. |
\r
1103 `----------------------------------------------------*/
\r
1105 if (yyerrstatus == 3)
\r
1107 /* If just tried and failed to reuse lookahead token after an
\r
1108 error, discard it. */
\r
1110 /* Return failure if at end of input. */
\r
1111 if (yychar == YYEOF)
\r
1113 /* Pop the error token. */
\r
1115 /* Pop the rest of the stack. */
\r
1116 while (yyssp > yyss)
\r
1118 YYDPRINTF ((stderr, "Error: popping "));
\r
1119 YYDSYMPRINT ((stderr,
\r
1122 YYDPRINTF ((stderr, "\n"));
\r
1123 yydestruct (yystos[*yyssp], *yyvsp);
\r
1129 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
\r
1130 yychar, yytname[yychar1]));
\r
1131 yydestruct (yychar1, yylval);
\r
1135 /* Else will try to reuse lookahead token after shifting the error
\r
1138 yyerrstatus = 3; /* Each real token shifted decrements this. */
\r
1142 yyn = yypact[yystate];
\r
1143 if (yyn != YYPACT_NINF)
\r
1146 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
\r
1148 yyn = yytable[yyn];
\r
1154 /* Pop the current state because it cannot handle the error token. */
\r
1155 if (yyssp == yyss)
\r
1158 YYDPRINTF ((stderr, "Error: popping "));
\r
1159 YYDSYMPRINT ((stderr,
\r
1160 yystos[*yyssp], *yyvsp));
\r
1161 YYDPRINTF ((stderr, "\n"));
\r
1163 yydestruct (yystos[yystate], *yyvsp);
\r
1165 yystate = *--yyssp;
\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
1180 if (yyn == YYFINAL)
\r
1183 YYDPRINTF ((stderr, "Shifting error token, "));
\r
1185 *++yyvsp = yylval;
\r
1192 /*-------------------------------------.
\r
1193 | yyacceptlab -- YYACCEPT comes here. |
\r
1194 `-------------------------------------*/
\r
1199 /*-----------------------------------.
\r
1200 | yyabortlab -- YYABORT comes here. |
\r
1201 `-----------------------------------*/
\r
1206 #ifndef yyoverflow
\r
1207 /*----------------------------------------------.
\r
1208 | yyoverflowlab -- parser overflow comes here. |
\r
1209 `----------------------------------------------*/
\r
1211 yyerror ("parser stack overflow");
\r
1213 /* Fall through. */
\r
1217 #ifndef yyoverflow
\r
1218 if (yyss != yyssa)
\r
1219 YYSTACK_FREE (yyss);
\r