47 #define YYBISON_VERSION "3.0.5" 50 #define YYSKELETON_NAME "yacc.c" 63 #define yyparse yyxmlparse 64 #define yylex yyxmllex 65 #define yyerror yyxmlerror 66 #define yydebug yyxmldebug 67 #define yynerrs yyxmlnerrs 69 #define yylval yyxmllval 70 #define yychar yyxmlchar 89 #line 90 "xml_y.tab.cpp" 92 # if defined __cplusplus && 201103L <= __cplusplus 93 # define YY_NULLPTR nullptr 100 #ifdef YYERROR_VERBOSE 101 # undef YYERROR_VERBOSE 102 # define YYERROR_VERBOSE 1 104 # define YYERROR_VERBOSE 1 109 #ifndef YY_YYXML_XML_Y_TAB_HPP_INCLUDED 110 # define YY_YYXML_XML_Y_TAB_HPP_INCLUDED 116 extern int yyxmldebug;
141 #define STARTXMLDECL 258 157 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 164 #line 165 "xml_y.tab.cpp" 168 # define YYSTYPE_IS_TRIVIAL 1 169 # define YYSTYPE_IS_DECLARED 1 181 #line 182 "xml_y.tab.cpp" 212 # ifdef __SIZE_TYPE__ 213 # define YYSIZE_T __SIZE_TYPE__ 214 # elif defined size_t 215 # define YYSIZE_T size_t 216 # elif ! defined YYSIZE_T 218 # define YYSIZE_T size_t 220 # define YYSIZE_T unsigned int 224 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 227 # if defined YYENABLE_NLS && YYENABLE_NLS 229 # include <libintl.h> 230 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 234 # define YY_(Msgid) Msgid 239 # if (defined __GNUC__ \ 240 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 241 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 242 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 244 # define YY_ATTRIBUTE(Spec) 248 #ifndef YY_ATTRIBUTE_PURE 249 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 252 #ifndef YY_ATTRIBUTE_UNUSED 253 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 256 #if !defined _Noreturn \ 257 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 258 # if defined _MSC_VER && 1200 <= _MSC_VER 259 # define _Noreturn __declspec (noreturn) 261 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 266 #if ! defined lint || defined __GNUC__ 267 # define YYUSE(E) ((void) (E)) 272 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 274 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 275 _Pragma ("GCC diagnostic push") \ 276 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 277 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 278 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 279 _Pragma ("GCC diagnostic pop") 281 # define YY_INITIAL_VALUE(Value) Value 283 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 284 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 285 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 287 #ifndef YY_INITIAL_VALUE 288 # define YY_INITIAL_VALUE(Value) 292 #if ! defined yyoverflow || YYERROR_VERBOSE 296 # ifdef YYSTACK_USE_ALLOCA 297 # if YYSTACK_USE_ALLOCA 299 # define YYSTACK_ALLOC __builtin_alloca 300 # elif defined __BUILTIN_VA_ARG_INCR 303 # define YYSTACK_ALLOC __alloca 304 # elif defined _MSC_VER 306 # define alloca _alloca 308 # define YYSTACK_ALLOC alloca 309 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 312 # ifndef EXIT_SUCCESS 313 # define EXIT_SUCCESS 0 320 # ifdef YYSTACK_ALLOC 322 # define YYSTACK_FREE(Ptr) do { ; } while (0) 323 # ifndef YYSTACK_ALLOC_MAXIMUM 328 # define YYSTACK_ALLOC_MAXIMUM 4032 331 # define YYSTACK_ALLOC YYMALLOC 332 # define YYSTACK_FREE YYFREE 333 # ifndef YYSTACK_ALLOC_MAXIMUM 334 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 336 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 337 && ! ((defined YYMALLOC || defined malloc) \ 338 && (defined YYFREE || defined free))) 340 # ifndef EXIT_SUCCESS 341 # define EXIT_SUCCESS 0 345 # define YYMALLOC malloc 346 # if ! defined malloc && ! defined EXIT_SUCCESS 352 # if ! defined free && ! defined EXIT_SUCCESS 360 #if (! defined yyoverflow \ 361 && (! defined __cplusplus \ 362 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 372 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 376 # define YYSTACK_BYTES(N) \ 377 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 378 + YYSTACK_GAP_MAXIMUM) 380 # define YYCOPY_NEEDED 1 387 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 390 YYSIZE_T yynewbytes; \ 391 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 392 Stack = &yyptr->Stack_alloc; \ 393 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 394 yyptr += yynewbytes / sizeof (*yyptr); \ 400 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 404 # if defined __GNUC__ && 1 < __GNUC__ 405 # define YYCOPY(Dst, Src, Count) \ 406 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 408 # define YYCOPY(Dst, Src, Count) \ 412 for (yyi = 0; yyi < (Count); yyi++) \ 413 (Dst)[yyi] = (Src)[yyi]; \ 437 #define YYMAXUTOK 271 439 #define YYTRANSLATE(YYX) \ 440 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 446 0, 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, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
472 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
480 0, 29, 29, 33, 38, 40, 37, 42, 46, 47,
481 51, 52, 57, 59, 56, 64, 64, 72, 73, 73,
482 78, 79, 81, 80, 84, 88, 89, 93, 94, 98
486 #if YYDEBUG || YYERROR_VERBOSE || 1 491 "$end",
"error",
"$undefined",
"STARTXMLDECL",
"VERSION",
"STARTPI",
492 "ENDPI",
"EQ",
"SLASH",
"CLOSE",
"END",
"ENCODING",
"NAME",
"VALUE",
493 "DATA",
"COMMENT",
"START",
"$accept",
"document",
"prolog",
494 "XMLDecl_opt",
"$@1",
"$@2",
"misc_seq_opt",
"misc",
"PI",
"$@3",
"$@4",
495 "element",
"$@5",
"empty_or_content",
"$@6",
"content",
"$@7",
496 "name_opt",
"attribute_seq_opt",
"attribute",
YY_NULLPTR 505 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
506 265, 266, 267, 268, 269, 270, 271
510 #define YYPACT_NINF -13 512 #define yypact_value_is_default(Yystate) \ 513 (!!((Yystate) == (-13))) 515 #define YYTABLE_NINF -1 517 #define yytable_value_is_error(Yytable_value) \ 524 2, -13, 8, -7, -13, -13, -13, -13, -13, -3,
525 1, -13, -3, 3, -13, -13, -13, 7, 11, -13,
526 -5, -13, 5, -13, 10, -13, -13, -13, -13, -13,
527 -13, 1, -4, 14, 9, -13, -13, -7, -13, -13,
536 7, 4, 0, 0, 9, 28, 1, 15, 9, 3,
537 5, 28, 2, 0, 10, 8, 11, 0, 0, 27,
538 0, 12, 0, 6, 0, 18, 16, 28, 29, 17,
539 24, 13, 22, 0, 26, 20, 21, 0, 14, 25,
546 -13, -13, -13, -13, -13, -13, 15, -8, -13, -13,
547 -13, -12, -13, -13, -13, -13, -13, -13, -11, -13
553 -1, 2, 3, 4, 5, 18, 9, 15, 16, 27,
554 33, 8, 11, 26, 30, 32, 37, 40, 10, 19
562 20, 13, 13, 24, 25, 1, 34, 17, 6, 7,
563 35, 14, 14, 17, 22, 21, 31, 23, 28, 29,
564 38, 39, 42, 12, 36, 41
569 11, 5, 5, 8, 9, 3, 10, 12, 0, 16,
570 14, 15, 15, 12, 7, 12, 27, 6, 13, 9,
578 0, 3, 18, 19, 20, 21, 0, 16, 28, 23,
579 35, 29, 23, 5, 15, 24, 25, 12, 22, 36,
580 35, 12, 7, 6, 8, 9, 30, 26, 13, 9,
581 31, 35, 32, 27, 10, 14, 24, 33, 6, 12,
588 0, 17, 18, 19, 21, 22, 20, 20, 23, 23,
589 24, 24, 26, 27, 25, 29, 28, 30, 31, 30,
590 32, 32, 33, 32, 32, 34, 34, 35, 35, 36
596 0, 2, 3, 2, 0, 0, 5, 0, 2, 0,
597 1, 1, 0, 0, 6, 0, 4, 2, 0, 6,
598 2, 2, 0, 3, 0, 1, 0, 2, 0, 3
602 #define yyerrok (yyerrstatus = 0) 603 #define yyclearin (yychar = YYEMPTY) 607 #define YYACCEPT goto yyacceptlab 608 #define YYABORT goto yyabortlab 609 #define YYERROR goto yyerrorlab 612 #define YYRECOVERING() (!!yyerrstatus) 614 #define YYBACKUP(Token, Value) \ 616 if (yychar == YYEMPTY) \ 620 YYPOPSTACK (yylen); \ 626 yyerror (YY_("syntax error: cannot back up")); \ 633 #define YYERRCODE 256 642 # define YYFPRINTF fprintf 645 # define YYDPRINTF(Args) \ 652 #ifndef YY_LOCATION_PRINT 653 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 657 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 661 YYFPRINTF (stderr, "%s ", Title); \ 662 yy_symbol_print (stderr, \ 664 YYFPRINTF (stderr, "\n"); \ 674 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
676 FILE *yyo = yyoutput;
682 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
693 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
695 YYFPRINTF (yyoutput,
"%s %s (",
698 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
699 YYFPRINTF (yyoutput,
")");
710 YYFPRINTF (stderr,
"Stack now");
711 for (; yybottom <= yytop; yybottom++)
713 int yybot = *yybottom;
714 YYFPRINTF (stderr,
" %d", yybot);
716 YYFPRINTF (stderr,
"\n");
719 # define YY_STACK_PRINT(Bottom, Top) \ 722 yy_stack_print ((Bottom), (Top)); \ 733 unsigned long int yylno = yyrline[yyrule];
734 int yynrhs =
yyr2[yyrule];
736 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
739 for (yyi = 0; yyi < yynrhs; yyi++)
741 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
742 yy_symbol_print (stderr,
743 yystos[yyssp[yyi + 1 - yynrhs]],
744 &(yyvsp[(yyi + 1) - (yynrhs)])
746 YYFPRINTF (stderr,
"\n");
750 # define YY_REDUCE_PRINT(Rule) \ 753 yy_reduce_print (yyssp, yyvsp, Rule); \ 760 # define YYDPRINTF(Args) 761 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 762 # define YY_STACK_PRINT(Bottom, Top) 763 # define YY_REDUCE_PRINT(Rule) 769 # define YYINITDEPTH 200 780 # define YYMAXDEPTH 10000 787 # if defined __GLIBC__ && defined _STRING_H 788 # define yystrlen strlen 795 for (yylen = 0; yystr[yylen]; yylen++)
803 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 804 # define yystpcpy stpcpy 812 const char *yys = yysrc;
814 while ((*yyd++ = *yys++) !=
'\0')
836 char const *yyp = yystr;
843 goto do_not_strip_quotes;
847 goto do_not_strip_quotes;
860 do_not_strip_quotes: ;
866 return yystpcpy (yyres, yystr) - yyres;
884 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
888 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
919 yyarg[yycount++] =
yytname[yytoken];
925 int yyxbegin = yyn < 0 ? -yyn : 0;
927 int yychecklim =
YYLAST - yyn + 1;
931 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
935 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
941 yyarg[yycount++] =
yytname[yyx];
944 if (! (yysize <= yysize1
955 # define YYCASE_(N, S) \ 961 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
962 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
963 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
964 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
965 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
976 if (*yymsg_alloc < yysize)
978 *yymsg_alloc = 2 * yysize;
979 if (! (yysize <= *yymsg_alloc
991 while ((*yyp = *yyformat) !=
'\0')
992 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1077 char *yymsg = yymsgbuf;
1078 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1081 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1087 yyssp = yyss = yyssa;
1088 yyvsp = yyvs = yyvsa;
1091 YYDPRINTF ((stderr,
"Starting parse\n"));
1110 if (yyss + yystacksize - 1 <= yyssp)
1113 YYSIZE_T yysize = yyssp - yyss + 1;
1127 yyoverflow (
YY_(
"memory exhausted"),
1128 &yyss1, yysize *
sizeof (*yyssp),
1129 &yyvs1, yysize *
sizeof (*yyvsp),
1136 # ifndef YYSTACK_RELOCATE 1137 goto yyexhaustedlab;
1141 goto yyexhaustedlab;
1151 goto yyexhaustedlab;
1154 # undef YYSTACK_RELOCATE 1161 yyssp = yyss + yysize - 1;
1162 yyvsp = yyvs + yysize - 1;
1164 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1165 (
unsigned long int) yystacksize));
1167 if (yyss + yystacksize - 1 <= yyssp)
1171 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1196 YYDPRINTF ((stderr,
"Reading a token: "));
1203 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1269 yyval = yyvsp[1-yylen];
1278 #line 1279 "xml_y.tab.cpp" 1284 #line 1285 "xml_y.tab.cpp" 1289 {
free((yyvsp[0].s)); }
1290 #line 1291 "xml_y.tab.cpp" 1296 #line 1297 "xml_y.tab.cpp" 1302 #line 1303 "xml_y.tab.cpp" 1310 #line 1311 "xml_y.tab.cpp" 1316 #line 1317 "xml_y.tab.cpp" 1322 #line 1323 "xml_y.tab.cpp" 1327 {
free((yyvsp[-1].s)); }
1328 #line 1329 "xml_y.tab.cpp" 1334 #line 1335 "xml_y.tab.cpp" 1340 #line 1341 "xml_y.tab.cpp" 1346 #line 1347 "xml_y.tab.cpp" 1351 { (yyval.
s)=(yyvsp[0].s); }
1352 #line 1353 "xml_y.tab.cpp" 1357 { (yyval.
s)=strdup(
""); }
1358 #line 1359 "xml_y.tab.cpp" 1365 free((yyvsp[-2].s));
free((yyvsp[0].s));}
1366 #line 1367 "xml_y.tab.cpp" 1370 #line 1371 "xml_y.tab.cpp" 1399 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
1419 #if ! YYERROR_VERBOSE 1422 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1425 char const *yymsgp =
YY_(
"syntax error");
1426 int yysyntax_error_status;
1428 if (yysyntax_error_status == 0)
1430 else if (yysyntax_error_status == 1)
1432 if (yymsg != yymsgbuf)
1438 yymsg_alloc =
sizeof yymsgbuf;
1439 yysyntax_error_status = 2;
1448 if (yysyntax_error_status == 2)
1449 goto yyexhaustedlab;
1451 # undef YYSYNTAX_ERROR 1457 if (yyerrstatus == 3)
1559 #if !defined yyoverflow || YYERROR_VERBOSE 1582 while (yyssp != yyss)
1593 if (yymsg != yymsgbuf)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_uint8 yystos[]
unsigned char yytype_uint8
static size_t yystrlen(const char *yystr)
static char * yystpcpy(char *yydest, const char *yysrc)
static const yytype_uint8 yytable[]
static size_t yytnamerr(char *yyres, const char *yystr)
void parse_error(const std::string &message, const std::string &before)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define yypact_value_is_default(Yystate)
unsigned short int yytype_uint16
static const yytype_uint8 yydefact[]
static const yytype_uint8 yyr2[]
int yyxmllex()
The main scanner function which does all the work.
void set_attribute(const std::string &attribute, unsigned value)
unsigned char yytype_uint8
static const yytype_int8 yypgoto[]
static std::string unescape(const std::string &s)
takes a string and unescapes any xml style escaped symbols
#define YY_STACK_PRINT(Bottom, Top)
static const yytype_int8 yypact[]
std::list< xmlt * > stack
static const yytype_uint8 yycheck[]
static const yytype_int8 yydefgoto[]
#define YYSTACK_ALLOC_MAXIMUM
#define YY_REDUCE_PRINT(Rule)
unsigned short int yytype_uint16
static const char *const yytname[]
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
int yyxmlerror(const std::string &error)
static const yytype_uint8 yyr1[]
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
static int yysyntax_error(size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
static const yytype_uint8 yytranslate[]
xml_parse_treet parse_tree
#define yytable_value_is_error(Yytable_value)