51 #define YYBISON_VERSION "3.5"
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
72 #define yylval yyxmllval
73 #define yychar yyxmlchar
92 #line 93 "xml_y.tab.cpp"
96 # define YY_CAST(Type, Val) static_cast<Type> (Val)
97 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
99 # define YY_CAST(Type, Val) ((Type) (Val))
100 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
104 # if defined __cplusplus
105 # if 201103L <= __cplusplus
106 # define YY_NULLPTR nullptr
108 # define YY_NULLPTR 0
111 # define YY_NULLPTR ((void*)0)
116 #ifdef YYERROR_VERBOSE
117 # undef YYERROR_VERBOSE
118 # define YYERROR_VERBOSE 1
120 # define YYERROR_VERBOSE 1
125 #ifndef YY_YYXML_XML_Y_TAB_HPP_INCLUDED
126 # define YY_YYXML_XML_Y_TAB_HPP_INCLUDED
132 extern int yyxmldebug;
157 #define STARTXMLDECL 258
173 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
179 #line 180 "xml_y.tab.cpp"
183 # define YYSTYPE_IS_TRIVIAL 1
184 # define YYSTYPE_IS_DECLARED 1
204 #ifndef __PTRDIFF_MAX__
206 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
217 #ifdef __INT_LEAST8_MAX__
219 #elif defined YY_STDINT_H
225 #ifdef __INT_LEAST16_MAX__
227 #elif defined YY_STDINT_H
233 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
235 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
236 && UINT_LEAST8_MAX <= INT_MAX)
238 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
244 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
246 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
247 && UINT_LEAST16_MAX <= INT_MAX)
249 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
256 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
257 # define YYPTRDIFF_T __PTRDIFF_TYPE__
258 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
259 # elif defined PTRDIFF_MAX
263 # define YYPTRDIFF_T ptrdiff_t
264 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
266 # define YYPTRDIFF_T long
267 # define YYPTRDIFF_MAXIMUM LONG_MAX
272 # ifdef __SIZE_TYPE__
273 # define YYSIZE_T __SIZE_TYPE__
274 # elif defined size_t
275 # define YYSIZE_T size_t
276 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
278 # define YYSIZE_T size_t
280 # define YYSIZE_T unsigned
284 #define YYSIZE_MAXIMUM \
285 YY_CAST (YYPTRDIFF_T, \
286 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
287 ? YYPTRDIFF_MAXIMUM \
288 : YY_CAST (YYSIZE_T, -1)))
290 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
299 # if defined YYENABLE_NLS && YYENABLE_NLS
301 # include <libintl.h>
302 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
306 # define YY_(Msgid) Msgid
310 #ifndef YY_ATTRIBUTE_PURE
311 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
312 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
314 # define YY_ATTRIBUTE_PURE
318 #ifndef YY_ATTRIBUTE_UNUSED
319 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
320 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
322 # define YY_ATTRIBUTE_UNUSED
327 #if ! defined lint || defined __GNUC__
328 # define YYUSE(E) ((void) (E))
333 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
335 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
336 _Pragma ("GCC diagnostic push") \
337 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
338 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
339 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
340 _Pragma ("GCC diagnostic pop")
342 # define YY_INITIAL_VALUE(Value) Value
344 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
345 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
346 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
348 #ifndef YY_INITIAL_VALUE
349 # define YY_INITIAL_VALUE(Value)
352 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
353 # define YY_IGNORE_USELESS_CAST_BEGIN \
354 _Pragma ("GCC diagnostic push") \
355 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
356 # define YY_IGNORE_USELESS_CAST_END \
357 _Pragma ("GCC diagnostic pop")
359 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
360 # define YY_IGNORE_USELESS_CAST_BEGIN
361 # define YY_IGNORE_USELESS_CAST_END
365 #define YY_ASSERT(E) ((void) (0 && (E)))
367 #if ! defined yyoverflow || YYERROR_VERBOSE
371 # ifdef YYSTACK_USE_ALLOCA
372 # if YYSTACK_USE_ALLOCA
374 # define YYSTACK_ALLOC __builtin_alloca
375 # elif defined __BUILTIN_VA_ARG_INCR
378 # define YYSTACK_ALLOC __alloca
379 # elif defined _MSC_VER
381 # define alloca _alloca
383 # define YYSTACK_ALLOC alloca
384 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
387 # ifndef EXIT_SUCCESS
388 # define EXIT_SUCCESS 0
395 # ifdef YYSTACK_ALLOC
397 # define YYSTACK_FREE(Ptr) do { ; } while (0)
398 # ifndef YYSTACK_ALLOC_MAXIMUM
403 # define YYSTACK_ALLOC_MAXIMUM 4032
406 # define YYSTACK_ALLOC YYMALLOC
407 # define YYSTACK_FREE YYFREE
408 # ifndef YYSTACK_ALLOC_MAXIMUM
409 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
411 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
412 && ! ((defined YYMALLOC || defined malloc) \
413 && (defined YYFREE || defined free)))
415 # ifndef EXIT_SUCCESS
416 # define EXIT_SUCCESS 0
420 # define YYMALLOC malloc
421 # if ! defined malloc && ! defined EXIT_SUCCESS
427 # if ! defined free && ! defined EXIT_SUCCESS
435 #if (! defined yyoverflow \
436 && (! defined __cplusplus \
437 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
447 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
451 # define YYSTACK_BYTES(N) \
452 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
453 + YYSTACK_GAP_MAXIMUM)
455 # define YYCOPY_NEEDED 1
462 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
465 YYPTRDIFF_T yynewbytes; \
466 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
467 Stack = &yyptr->Stack_alloc; \
468 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
469 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
475 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
479 # if defined __GNUC__ && 1 < __GNUC__
480 # define YYCOPY(Dst, Src, Count) \
481 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
483 # define YYCOPY(Dst, Src, Count) \
487 for (yyi = 0; yyi < (Count); yyi++) \
488 (Dst)[yyi] = (Src)[yyi]; \
510 #define YYMAXUTOK 271
515 #define YYTRANSLATE(YYX) \
516 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
522 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
548 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
556 0, 29, 29, 33, 38, 40, 37, 42, 46, 47,
557 51, 52, 57, 59, 56, 64, 64, 72, 73, 73,
558 78, 79, 81, 80, 84, 88, 89, 93, 94, 98
562 #if YYDEBUG || YYERROR_VERBOSE || 1
567 "$end",
"error",
"$undefined",
"STARTXMLDECL",
"VERSION",
"STARTPI",
568 "ENDPI",
"EQ",
"SLASH",
"CLOSE",
"END",
"ENCODING",
"NAME",
"VALUE",
569 "DATA",
"COMMENT",
"START",
"$accept",
"document",
"prolog",
570 "XMLDecl_opt",
"$@1",
"$@2",
"misc_seq_opt",
"misc",
"PI",
"$@3",
"$@4",
571 "element",
"$@5",
"empty_or_content",
"$@6",
"content",
"$@7",
572 "name_opt",
"attribute_seq_opt",
"attribute",
YY_NULLPTR
581 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
582 265, 266, 267, 268, 269, 270, 271
586 #define YYPACT_NINF (-13)
588 #define yypact_value_is_default(Yyn) \
589 ((Yyn) == YYPACT_NINF)
591 #define YYTABLE_NINF (-1)
593 #define yytable_value_is_error(Yyn) \
600 2, -13, 8, -7, -13, -13, -13, -13, -13, -3,
601 1, -13, -3, 3, -13, -13, -13, 7, 11, -13,
602 -5, -13, 5, -13, 10, -13, -13, -13, -13, -13,
603 -13, 1, -4, 14, 9, -13, -13, -7, -13, -13,
612 7, 4, 0, 0, 9, 28, 1, 15, 9, 3,
613 5, 28, 2, 0, 10, 8, 11, 0, 0, 27,
614 0, 12, 0, 6, 0, 18, 16, 28, 29, 17,
615 24, 13, 22, 0, 26, 20, 21, 0, 14, 25,
622 -13, -13, -13, -13, -13, -13, 15, -8, -13, -13,
623 -13, -12, -13, -13, -13, -13, -13, -13, -11, -13
629 -1, 2, 3, 4, 5, 18, 9, 15, 16, 27,
630 33, 8, 11, 26, 30, 32, 37, 40, 10, 19
638 20, 13, 13, 24, 25, 1, 34, 17, 6, 7,
639 35, 14, 14, 17, 22, 21, 31, 23, 28, 29,
640 38, 39, 42, 12, 36, 41
645 11, 5, 5, 8, 9, 3, 10, 12, 0, 16,
646 14, 15, 15, 12, 7, 12, 27, 6, 13, 9,
654 0, 3, 18, 19, 20, 21, 0, 16, 28, 23,
655 35, 29, 23, 5, 15, 24, 25, 12, 22, 36,
656 35, 12, 7, 6, 8, 9, 30, 26, 13, 9,
657 31, 35, 32, 27, 10, 14, 24, 33, 6, 12,
664 0, 17, 18, 19, 21, 22, 20, 20, 23, 23,
665 24, 24, 26, 27, 25, 29, 28, 30, 31, 30,
666 32, 32, 33, 32, 32, 34, 34, 35, 35, 36
672 0, 2, 3, 2, 0, 0, 5, 0, 2, 0,
673 1, 1, 0, 0, 6, 0, 4, 2, 0, 6,
674 2, 2, 0, 3, 0, 1, 0, 2, 0, 3
678 #define yyerrok (yyerrstatus = 0)
679 #define yyclearin (yychar = YYEMPTY)
683 #define YYACCEPT goto yyacceptlab
684 #define YYABORT goto yyabortlab
685 #define YYERROR goto yyerrorlab
688 #define YYRECOVERING() (!!yyerrstatus)
690 #define YYBACKUP(Token, Value) \
692 if (yychar == YYEMPTY) \
696 YYPOPSTACK (yylen); \
702 yyerror (YY_("syntax error: cannot back up")); \
709 #define YYERRCODE 256
718 # define YYFPRINTF fprintf
721 # define YYDPRINTF(Args) \
728 #ifndef YY_LOCATION_PRINT
729 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
733 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
737 YYFPRINTF (stderr, "%s ", Title); \
738 yy_symbol_print (stderr, \
740 YYFPRINTF (stderr, "\n"); \
750 yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
752 FILE *yyoutput = yyo;
758 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
771 yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
773 YYFPRINTF (yyo,
"%s %s (",
776 yy_symbol_value_print (yyo, yytype, yyvaluep);
777 YYFPRINTF (yyo,
")");
788 YYFPRINTF (stderr,
"Stack now");
789 for (; yybottom <= yytop; yybottom++)
791 int yybot = *yybottom;
792 YYFPRINTF (stderr,
" %d", yybot);
794 YYFPRINTF (stderr,
"\n");
797 # define YY_STACK_PRINT(Bottom, Top) \
800 yy_stack_print ((Bottom), (Top)); \
811 int yylno = yyrline[yyrule];
812 int yynrhs =
yyr2[yyrule];
814 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
817 for (yyi = 0; yyi < yynrhs; yyi++)
819 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
820 yy_symbol_print (stderr,
821 yystos[yyssp[yyi + 1 - yynrhs]],
822 &yyvsp[(yyi + 1) - (yynrhs)]
824 YYFPRINTF (stderr,
"\n");
828 # define YY_REDUCE_PRINT(Rule) \
831 yy_reduce_print (yyssp, yyvsp, Rule); \
838 # define YYDPRINTF(Args)
839 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
840 # define YY_STACK_PRINT(Bottom, Top)
841 # define YY_REDUCE_PRINT(Rule)
847 # define YYINITDEPTH 200
858 # define YYMAXDEPTH 10000
865 # if defined __GLIBC__ && defined _STRING_H
866 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
873 for (yylen = 0; yystr[yylen]; yylen++)
881 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
882 # define yystpcpy stpcpy
890 const char *yys = yysrc;
892 while ((*yyd++ = *yys++) !=
'\0')
914 char const *yyp = yystr;
921 goto do_not_strip_quotes;
925 goto do_not_strip_quotes;
941 do_not_strip_quotes: ;
945 return yystpcpy (yyres, yystr) - yyres;
963 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
968 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1002 yyarg[yycount++] =
yytname[yytoken];
1008 int yyxbegin = yyn < 0 ? -yyn : 0;
1010 int yychecklim =
YYLAST - yyn + 1;
1014 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1018 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1024 yyarg[yycount++] =
yytname[yyx];
1039 # define YYCASE_(N, S) \
1045 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1046 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1047 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1048 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1049 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1063 if (*yymsg_alloc < yysize)
1065 *yymsg_alloc = 2 * yysize;
1066 if (! (yysize <= *yymsg_alloc
1078 while ((*yyp = *yyformat) !=
'\0')
1079 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1164 char *yymsg = yymsgbuf;
1168 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1174 yyssp = yyss = yyssa;
1175 yyvsp = yyvs = yyvsa;
1178 YYDPRINTF ((stderr,
"Starting parse\n"));
1200 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1206 if (yyss + yystacksize - 1 <= yyssp)
1207 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1208 goto yyexhaustedlab;
1214 # if defined yyoverflow
1226 yyoverflow (
YY_(
"memory exhausted"),
1227 &yyss1, yysize *
YYSIZEOF (*yyssp),
1228 &yyvs1, yysize *
YYSIZEOF (*yyvsp),
1236 goto yyexhaustedlab;
1247 goto yyexhaustedlab;
1250 # undef YYSTACK_RELOCATE
1256 yyssp = yyss + yysize - 1;
1257 yyvsp = yyvs + yysize - 1;
1260 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1261 YY_CAST (
long, yystacksize)));
1264 if (yyss + yystacksize - 1 <= yyssp)
1292 YYDPRINTF ((stderr,
"Reading a token: "));
1299 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1363 yyval = yyvsp[1-yylen];
1372 #line 1373 "xml_y.tab.cpp"
1378 #line 1379 "xml_y.tab.cpp"
1383 {
free((yyvsp[0].s)); }
1384 #line 1385 "xml_y.tab.cpp"
1390 #line 1391 "xml_y.tab.cpp"
1396 #line 1397 "xml_y.tab.cpp"
1404 #line 1405 "xml_y.tab.cpp"
1410 #line 1411 "xml_y.tab.cpp"
1416 #line 1417 "xml_y.tab.cpp"
1421 {
free((yyvsp[-1].s)); }
1422 #line 1423 "xml_y.tab.cpp"
1428 #line 1429 "xml_y.tab.cpp"
1434 #line 1435 "xml_y.tab.cpp"
1440 #line 1441 "xml_y.tab.cpp"
1445 { (yyval.
s)=(yyvsp[0].s); }
1446 #line 1447 "xml_y.tab.cpp"
1451 { (yyval.
s)=strdup(
""); }
1452 #line 1453 "xml_y.tab.cpp"
1459 free((yyvsp[-2].s));
free((yyvsp[0].s));}
1460 #line 1461 "xml_y.tab.cpp"
1464 #line 1465 "xml_y.tab.cpp"
1492 const int yyi =
yypgoto[yylhs] + *yyssp;
1493 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
1513 #if ! YYERROR_VERBOSE
1516 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1519 char const *yymsgp =
YY_(
"syntax error");
1520 int yysyntax_error_status;
1522 if (yysyntax_error_status == 0)
1524 else if (yysyntax_error_status == 1)
1526 if (yymsg != yymsgbuf)
1532 yymsg_alloc =
sizeof yymsgbuf;
1533 yysyntax_error_status = 2;
1542 if (yysyntax_error_status == 2)
1543 goto yyexhaustedlab;
1545 # undef YYSYNTAX_ERROR
1551 if (yyerrstatus == 3)
1653 #if !defined yyoverflow || YYERROR_VERBOSE
1680 while (yyssp != yyss)
1691 if (yymsg != yymsgbuf)