51 #define YYBISON_VERSION "3.4.1"
54 #define YYSKELETON_NAME "yacc.c"
67 #define yyparse yyxmlparse
68 #define yylex yyxmllex
69 #define yyerror yyxmlerror
70 #define yydebug yyxmldebug
71 #define yynerrs yyxmlnerrs
73 #define yylval yyxmllval
74 #define yychar yyxmlchar
93 #line 94 "xml_y.tab.cpp"
96 # if defined __cplusplus
97 # if 201103L <= __cplusplus
98 # define YY_NULLPTR nullptr
100 # define YY_NULLPTR 0
103 # define YY_NULLPTR ((void*)0)
108 #ifdef YYERROR_VERBOSE
109 # undef YYERROR_VERBOSE
110 # define YYERROR_VERBOSE 1
112 # define YYERROR_VERBOSE 1
117 #ifndef YY_YYXML_XML_Y_TAB_HPP_INCLUDED
118 # define YY_YYXML_XML_Y_TAB_HPP_INCLUDED
124 extern int yyxmldebug;
149 #define STARTXMLDECL 258
165 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
171 #line 172 "xml_y.tab.cpp"
175 # define YYSTYPE_IS_TRIVIAL 1
176 # define YYSTYPE_IS_DECLARED 1
217 # ifdef __SIZE_TYPE__
218 # define YYSIZE_T __SIZE_TYPE__
219 # elif defined size_t
220 # define YYSIZE_T size_t
221 # elif ! defined YYSIZE_T
223 # define YYSIZE_T size_t
225 # define YYSIZE_T unsigned
229 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
232 # if defined YYENABLE_NLS && YYENABLE_NLS
234 # include <libintl.h>
235 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
239 # define YY_(Msgid) Msgid
244 # if (defined __GNUC__ \
245 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
246 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
247 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
249 # define YY_ATTRIBUTE(Spec)
253 #ifndef YY_ATTRIBUTE_PURE
254 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
257 #ifndef YY_ATTRIBUTE_UNUSED
258 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
262 #if ! defined lint || defined __GNUC__
263 # define YYUSE(E) ((void) (E))
268 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
270 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
271 _Pragma ("GCC diagnostic push") \
272 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
273 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
274 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
275 _Pragma ("GCC diagnostic pop")
277 # define YY_INITIAL_VALUE(Value) Value
279 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
280 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
281 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
283 #ifndef YY_INITIAL_VALUE
284 # define YY_INITIAL_VALUE(Value)
288 #define YY_ASSERT(E) ((void) (0 && (E)))
290 #if ! defined yyoverflow || YYERROR_VERBOSE
294 # ifdef YYSTACK_USE_ALLOCA
295 # if YYSTACK_USE_ALLOCA
297 # define YYSTACK_ALLOC __builtin_alloca
298 # elif defined __BUILTIN_VA_ARG_INCR
301 # define YYSTACK_ALLOC __alloca
302 # elif defined _MSC_VER
304 # define alloca _alloca
306 # define YYSTACK_ALLOC alloca
307 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
310 # ifndef EXIT_SUCCESS
311 # define EXIT_SUCCESS 0
318 # ifdef YYSTACK_ALLOC
320 # define YYSTACK_FREE(Ptr) do { ; } while (0)
321 # ifndef YYSTACK_ALLOC_MAXIMUM
326 # define YYSTACK_ALLOC_MAXIMUM 4032
329 # define YYSTACK_ALLOC YYMALLOC
330 # define YYSTACK_FREE YYFREE
331 # ifndef YYSTACK_ALLOC_MAXIMUM
332 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
334 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
335 && ! ((defined YYMALLOC || defined malloc) \
336 && (defined YYFREE || defined free)))
338 # ifndef EXIT_SUCCESS
339 # define EXIT_SUCCESS 0
343 # define YYMALLOC malloc
344 # if ! defined malloc && ! defined EXIT_SUCCESS
350 # if ! defined free && ! defined EXIT_SUCCESS
358 #if (! defined yyoverflow \
359 && (! defined __cplusplus \
360 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
370 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
374 # define YYSTACK_BYTES(N) \
375 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
376 + YYSTACK_GAP_MAXIMUM)
378 # define YYCOPY_NEEDED 1
385 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
388 YYSIZE_T yynewbytes; \
389 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
390 Stack = &yyptr->Stack_alloc; \
391 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
392 yyptr += yynewbytes / sizeof (*yyptr); \
398 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
402 # if defined __GNUC__ && 1 < __GNUC__
403 # define YYCOPY(Dst, Src, Count) \
404 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
406 # define YYCOPY(Dst, Src, Count) \
410 for (yyi = 0; yyi < (Count); yyi++) \
411 (Dst)[yyi] = (Src)[yyi]; \
433 #define YYMAXUTOK 271
437 #define YYTRANSLATE(YYX) \
438 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
444 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
470 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
478 0, 29, 29, 33, 38, 40, 37, 42, 46, 47,
479 51, 52, 57, 59, 56, 64, 64, 72, 73, 73,
480 78, 79, 81, 80, 84, 88, 89, 93, 94, 98
484 #if YYDEBUG || YYERROR_VERBOSE || 1
489 "$end",
"error",
"$undefined",
"STARTXMLDECL",
"VERSION",
"STARTPI",
490 "ENDPI",
"EQ",
"SLASH",
"CLOSE",
"END",
"ENCODING",
"NAME",
"VALUE",
491 "DATA",
"COMMENT",
"START",
"$accept",
"document",
"prolog",
492 "XMLDecl_opt",
"$@1",
"$@2",
"misc_seq_opt",
"misc",
"PI",
"$@3",
"$@4",
493 "element",
"$@5",
"empty_or_content",
"$@6",
"content",
"$@7",
494 "name_opt",
"attribute_seq_opt",
"attribute",
YY_NULLPTR
503 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
504 265, 266, 267, 268, 269, 270, 271
508 #define YYPACT_NINF -13
510 #define yypact_value_is_default(Yystate) \
511 (!!((Yystate) == (-13)))
513 #define YYTABLE_NINF -1
515 #define yytable_value_is_error(Yytable_value) \
522 2, -13, 8, -7, -13, -13, -13, -13, -13, -3,
523 1, -13, -3, 3, -13, -13, -13, 7, 11, -13,
524 -5, -13, 5, -13, 10, -13, -13, -13, -13, -13,
525 -13, 1, -4, 14, 9, -13, -13, -7, -13, -13,
534 7, 4, 0, 0, 9, 28, 1, 15, 9, 3,
535 5, 28, 2, 0, 10, 8, 11, 0, 0, 27,
536 0, 12, 0, 6, 0, 18, 16, 28, 29, 17,
537 24, 13, 22, 0, 26, 20, 21, 0, 14, 25,
544 -13, -13, -13, -13, -13, -13, 15, -8, -13, -13,
545 -13, -12, -13, -13, -13, -13, -13, -13, -11, -13
551 -1, 2, 3, 4, 5, 18, 9, 15, 16, 27,
552 33, 8, 11, 26, 30, 32, 37, 40, 10, 19
560 20, 13, 13, 24, 25, 1, 34, 17, 6, 7,
561 35, 14, 14, 17, 22, 21, 31, 23, 28, 29,
562 38, 39, 42, 12, 36, 41
567 11, 5, 5, 8, 9, 3, 10, 12, 0, 16,
568 14, 15, 15, 12, 7, 12, 27, 6, 13, 9,
576 0, 3, 18, 19, 20, 21, 0, 16, 28, 23,
577 35, 29, 23, 5, 15, 24, 25, 12, 22, 36,
578 35, 12, 7, 6, 8, 9, 30, 26, 13, 9,
579 31, 35, 32, 27, 10, 14, 24, 33, 6, 12,
586 0, 17, 18, 19, 21, 22, 20, 20, 23, 23,
587 24, 24, 26, 27, 25, 29, 28, 30, 31, 30,
588 32, 32, 33, 32, 32, 34, 34, 35, 35, 36
594 0, 2, 3, 2, 0, 0, 5, 0, 2, 0,
595 1, 1, 0, 0, 6, 0, 4, 2, 0, 6,
596 2, 2, 0, 3, 0, 1, 0, 2, 0, 3
600 #define yyerrok (yyerrstatus = 0)
601 #define yyclearin (yychar = YYEMPTY)
605 #define YYACCEPT goto yyacceptlab
606 #define YYABORT goto yyabortlab
607 #define YYERROR goto yyerrorlab
610 #define YYRECOVERING() (!!yyerrstatus)
612 #define YYBACKUP(Token, Value) \
614 if (yychar == YYEMPTY) \
618 YYPOPSTACK (yylen); \
624 yyerror (YY_("syntax error: cannot back up")); \
631 #define YYERRCODE 256
640 # define YYFPRINTF fprintf
643 # define YYDPRINTF(Args) \
650 #ifndef YY_LOCATION_PRINT
651 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
655 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
659 YYFPRINTF (stderr, "%s ", Title); \
660 yy_symbol_print (stderr, \
662 YYFPRINTF (stderr, "\n"); \
672 yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
674 FILE *yyoutput = yyo;
680 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
691 yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
693 YYFPRINTF (yyo,
"%s %s (",
696 yy_symbol_value_print (yyo, yytype, yyvaluep);
697 YYFPRINTF (yyo,
")");
708 YYFPRINTF (stderr,
"Stack now");
709 for (; yybottom <= yytop; yybottom++)
711 int yybot = *yybottom;
712 YYFPRINTF (stderr,
" %d", yybot);
714 YYFPRINTF (stderr,
"\n");
717 # define YY_STACK_PRINT(Bottom, Top) \
720 yy_stack_print ((Bottom), (Top)); \
731 unsigned long yylno = yyrline[yyrule];
732 int yynrhs =
yyr2[yyrule];
734 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
737 for (yyi = 0; yyi < yynrhs; yyi++)
739 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
740 yy_symbol_print (stderr,
741 yystos[yyssp[yyi + 1 - yynrhs]],
742 &yyvsp[(yyi + 1) - (yynrhs)]
744 YYFPRINTF (stderr,
"\n");
748 # define YY_REDUCE_PRINT(Rule) \
751 yy_reduce_print (yyssp, yyvsp, Rule); \
758 # define YYDPRINTF(Args)
759 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
760 # define YY_STACK_PRINT(Bottom, Top)
761 # define YY_REDUCE_PRINT(Rule)
767 # define YYINITDEPTH 200
778 # define YYMAXDEPTH 10000
785 # if defined __GLIBC__ && defined _STRING_H
786 # define yystrlen strlen
793 for (yylen = 0; yystr[yylen]; yylen++)
801 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
802 # define yystpcpy stpcpy
810 const char *yys = yysrc;
812 while ((*yyd++ = *yys++) !=
'\0')
834 char const *yyp = yystr;
841 goto do_not_strip_quotes;
845 goto do_not_strip_quotes;
861 do_not_strip_quotes: ;
885 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
889 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
920 yyarg[yycount++] =
yytname[yytoken];
926 int yyxbegin = yyn < 0 ? -yyn : 0;
928 int yychecklim =
YYLAST - yyn + 1;
932 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
936 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
942 yyarg[yycount++] =
yytname[yyx];
956 # define YYCASE_(N, S) \
962 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
963 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
964 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
965 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
966 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
978 if (*yymsg_alloc < yysize)
980 *yymsg_alloc = 2 * yysize;
981 if (! (yysize <= *yymsg_alloc
993 while ((*yyp = *yyformat) !=
'\0')
994 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1079 char *yymsg = yymsgbuf;
1080 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1083 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1089 yyssp = yyss = yyssa;
1090 yyvsp = yyvs = yyvsa;
1093 YYDPRINTF ((stderr,
"Starting parse\n"));
1115 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1119 if (yyss + yystacksize - 1 <= yyssp)
1120 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1121 goto yyexhaustedlab;
1127 # if defined yyoverflow
1139 yyoverflow (
YY_(
"memory exhausted"),
1140 &yyss1, yysize *
sizeof (*yyssp),
1141 &yyvs1, yysize *
sizeof (*yyvsp),
1149 goto yyexhaustedlab;
1159 goto yyexhaustedlab;
1162 # undef YYSTACK_RELOCATE
1168 yyssp = yyss + yysize - 1;
1169 yyvsp = yyvs + yysize - 1;
1171 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1172 (
unsigned long) yystacksize));
1174 if (yyss + yystacksize - 1 <= yyssp)
1202 YYDPRINTF ((stderr,
"Reading a token: "));
1209 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1274 yyval = yyvsp[1-yylen];
1283 #line 1284 "xml_y.tab.cpp"
1289 #line 1290 "xml_y.tab.cpp"
1294 {
free((yyvsp[0].s)); }
1295 #line 1296 "xml_y.tab.cpp"
1301 #line 1302 "xml_y.tab.cpp"
1307 #line 1308 "xml_y.tab.cpp"
1315 #line 1316 "xml_y.tab.cpp"
1321 #line 1322 "xml_y.tab.cpp"
1327 #line 1328 "xml_y.tab.cpp"
1332 {
free((yyvsp[-1].s)); }
1333 #line 1334 "xml_y.tab.cpp"
1339 #line 1340 "xml_y.tab.cpp"
1345 #line 1346 "xml_y.tab.cpp"
1351 #line 1352 "xml_y.tab.cpp"
1356 { (yyval.
s)=(yyvsp[0].s); }
1357 #line 1358 "xml_y.tab.cpp"
1362 { (yyval.
s)=strdup(
""); }
1363 #line 1364 "xml_y.tab.cpp"
1370 free((yyvsp[-2].s));
free((yyvsp[0].s));}
1371 #line 1372 "xml_y.tab.cpp"
1375 #line 1376 "xml_y.tab.cpp"
1403 const int yyi =
yypgoto[yylhs] + *yyssp;
1404 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
1424 #if ! YYERROR_VERBOSE
1427 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1430 char const *yymsgp =
YY_(
"syntax error");
1431 int yysyntax_error_status;
1433 if (yysyntax_error_status == 0)
1435 else if (yysyntax_error_status == 1)
1437 if (yymsg != yymsgbuf)
1443 yymsg_alloc =
sizeof yymsgbuf;
1444 yysyntax_error_status = 2;
1453 if (yysyntax_error_status == 2)
1454 goto yyexhaustedlab;
1456 # undef YYSYNTAX_ERROR
1462 if (yyerrstatus == 3)
1564 #if !defined yyoverflow || YYERROR_VERBOSE
1591 while (yyssp != yyss)
1602 if (yymsg != yymsgbuf)