cprover
xml_y.tab.cpp
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.4.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* All symbols defined below should begin with yy or YY, to avoid
38  infringing on user name space. This should be done even for local
39  variables, as they might otherwise be expanded by user macros.
40  There are some unavoidable exceptions within include files to
41  define necessary library symbols; they are noted "INFRINGES ON
42  USER NAME SPACE" below. */
43 
44 /* Undocumented macros, especially those whose name start with YY_,
45  are private implementation details. Do not rely on them. */
46 
47 /* Identify Bison output. */
48 #define YYBISON 1
49 
50 /* Bison version. */
51 #define YYBISON_VERSION "3.4.1"
52 
53 /* Skeleton name. */
54 #define YYSKELETON_NAME "yacc.c"
55 
56 /* Pure parsers. */
57 #define YYPURE 0
58 
59 /* Push parsers. */
60 #define YYPUSH 0
61 
62 /* Pull parsers. */
63 #define YYPULL 1
64 
65 
66 /* Substitute the variable and function names. */
67 #define yyparse yyxmlparse
68 #define yylex yyxmllex
69 #define yyerror yyxmlerror
70 #define yydebug yyxmldebug
71 #define yynerrs yyxmlnerrs
72 
73 #define yylval yyxmllval
74 #define yychar yyxmlchar
75 
76 /* First part of user prologue. */
77 #line 1 "parser.y"
78 
79 #include <cstring>
80 
81 #include "xml_parser.h"
82 
83 int yyxmllex();
84 extern char *yyxmltext;
85 
86 int yyxmlerror(const std::string &error)
87 {
89  return 0;
90 }
91 
92 
93 #line 94 "xml_y.tab.cpp"
94 
95 # ifndef YY_NULLPTR
96 # if defined __cplusplus
97 # if 201103L <= __cplusplus
98 # define YY_NULLPTR nullptr
99 # else
100 # define YY_NULLPTR 0
101 # endif
102 # else
103 # define YY_NULLPTR ((void*)0)
104 # endif
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 1
113 #endif
114 
115 /* Use api.header.include to #include this header
116  instead of duplicating it here. */
117 #ifndef YY_YYXML_XML_Y_TAB_HPP_INCLUDED
118 # define YY_YYXML_XML_Y_TAB_HPP_INCLUDED
119 /* Debug traces. */
120 #ifndef YYDEBUG
121 # define YYDEBUG 0
122 #endif
123 #if YYDEBUG
124 extern int yyxmldebug;
125 #endif
126 
127 /* Token type. */
128 #ifndef YYTOKENTYPE
129 # define YYTOKENTYPE
131  {
133  VERSION = 259,
134  STARTPI = 260,
135  ENDPI = 261,
136  EQ = 262,
137  SLASH = 263,
138  CLOSE = 264,
139  END = 265,
140  ENCODING = 266,
141  NAME = 267,
142  VALUE = 268,
143  DATA = 269,
144  COMMENT = 270,
145  START = 271
146  };
147 #endif
148 /* Tokens. */
149 #define STARTXMLDECL 258
150 #define VERSION 259
151 #define STARTPI 260
152 #define ENDPI 261
153 #define EQ 262
154 #define SLASH 263
155 #define CLOSE 264
156 #define END 265
157 #define ENCODING 266
158 #define NAME 267
159 #define VALUE 268
160 #define DATA 269
161 #define COMMENT 270
162 #define START 271
163 
164 /* Value type. */
165 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
166 union YYSTYPE
167 {
168 #line 19 "parser.y"
169 char *s;
170 
171 #line 172 "xml_y.tab.cpp"
172 
173 };
174 typedef union YYSTYPE YYSTYPE;
175 # define YYSTYPE_IS_TRIVIAL 1
176 # define YYSTYPE_IS_DECLARED 1
177 #endif
178 
179 
180 extern YYSTYPE yyxmllval;
181 
182 int yyxmlparse (void);
183 
184 #endif /* !YY_YYXML_XML_Y_TAB_HPP_INCLUDED */
185 
186 
187 
188 #ifdef short
189 # undef short
190 #endif
191 
192 #ifdef YYTYPE_UINT8
193 typedef YYTYPE_UINT8 yytype_uint8;
194 #else
195 typedef unsigned char yytype_uint8;
196 #endif
197 
198 #ifdef YYTYPE_INT8
199 typedef YYTYPE_INT8 yytype_int8;
200 #else
201 typedef signed char yytype_int8;
202 #endif
203 
204 #ifdef YYTYPE_UINT16
205 typedef YYTYPE_UINT16 yytype_uint16;
206 #else
207 typedef unsigned short yytype_uint16;
208 #endif
209 
210 #ifdef YYTYPE_INT16
211 typedef YYTYPE_INT16 yytype_int16;
212 #else
213 typedef short yytype_int16;
214 #endif
215 
216 #ifndef YYSIZE_T
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
222 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
223 # define YYSIZE_T size_t
224 # else
225 # define YYSIZE_T unsigned
226 # endif
227 #endif
228 
229 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
230 
231 #ifndef YY_
232 # if defined YYENABLE_NLS && YYENABLE_NLS
233 # if ENABLE_NLS
234 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
235 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
236 # endif
237 # endif
238 # ifndef YY_
239 # define YY_(Msgid) Msgid
240 # endif
241 #endif
242 
243 #ifndef YY_ATTRIBUTE
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)
248 # else
249 # define YY_ATTRIBUTE(Spec) /* empty */
250 # endif
251 #endif
252 
253 #ifndef YY_ATTRIBUTE_PURE
254 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
255 #endif
256 
257 #ifndef YY_ATTRIBUTE_UNUSED
258 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
259 #endif
260 
261 /* Suppress unused-variable warnings by "using" E. */
262 #if ! defined lint || defined __GNUC__
263 # define YYUSE(E) ((void) (E))
264 #else
265 # define YYUSE(E) /* empty */
266 #endif
267 
268 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
269 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
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")
276 #else
277 # define YY_INITIAL_VALUE(Value) Value
278 #endif
279 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
280 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
281 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
282 #endif
283 #ifndef YY_INITIAL_VALUE
284 # define YY_INITIAL_VALUE(Value) /* Nothing. */
285 #endif
286 
287 
288 #define YY_ASSERT(E) ((void) (0 && (E)))
289 
290 #if ! defined yyoverflow || YYERROR_VERBOSE
291 
292 /* The parser invokes alloca or malloc; define the necessary symbols. */
293 
294 # ifdef YYSTACK_USE_ALLOCA
295 # if YYSTACK_USE_ALLOCA
296 # ifdef __GNUC__
297 # define YYSTACK_ALLOC __builtin_alloca
298 # elif defined __BUILTIN_VA_ARG_INCR
299 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
300 # elif defined _AIX
301 # define YYSTACK_ALLOC __alloca
302 # elif defined _MSC_VER
303 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
304 # define alloca _alloca
305 # else
306 # define YYSTACK_ALLOC alloca
307 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
308 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
309  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
310 # ifndef EXIT_SUCCESS
311 # define EXIT_SUCCESS 0
312 # endif
313 # endif
314 # endif
315 # endif
316 # endif
317 
318 # ifdef YYSTACK_ALLOC
319  /* Pacify GCC's 'empty if-body' warning. */
320 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
321 # ifndef YYSTACK_ALLOC_MAXIMUM
322  /* The OS might guarantee only one guard page at the bottom of the stack,
323  and a page size can be as small as 4096 bytes. So we cannot safely
324  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
325  to allow for a few compiler-allocated temporary stack slots. */
326 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
327 # endif
328 # else
329 # define YYSTACK_ALLOC YYMALLOC
330 # define YYSTACK_FREE YYFREE
331 # ifndef YYSTACK_ALLOC_MAXIMUM
332 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
333 # endif
334 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
335  && ! ((defined YYMALLOC || defined malloc) \
336  && (defined YYFREE || defined free)))
337 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
338 # ifndef EXIT_SUCCESS
339 # define EXIT_SUCCESS 0
340 # endif
341 # endif
342 # ifndef YYMALLOC
343 # define YYMALLOC malloc
344 # if ! defined malloc && ! defined EXIT_SUCCESS
345 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
346 # endif
347 # endif
348 # ifndef YYFREE
349 # define YYFREE free
350 # if ! defined free && ! defined EXIT_SUCCESS
351 void free (void *); /* INFRINGES ON USER NAME SPACE */
352 # endif
353 # endif
354 # endif
355 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
356 
357 
358 #if (! defined yyoverflow \
359  && (! defined __cplusplus \
360  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
361 
362 /* A type that is properly aligned for any stack member. */
363 union yyalloc
364 {
367 };
368 
369 /* The size of the maximum gap between one aligned stack and the next. */
370 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
371 
372 /* The size of an array large to enough to hold all stacks, each with
373  N elements. */
374 # define YYSTACK_BYTES(N) \
375  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
376  + YYSTACK_GAP_MAXIMUM)
377 
378 # define YYCOPY_NEEDED 1
379 
380 /* Relocate STACK from its old location to the new one. The
381  local variables YYSIZE and YYSTACKSIZE give the old and new number of
382  elements in the stack, and YYPTR gives the new location of the
383  stack. Advance YYPTR to a properly aligned location for the next
384  stack. */
385 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
386  do \
387  { \
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); \
393  } \
394  while (0)
395 
396 #endif
397 
398 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
399 /* Copy COUNT objects from SRC to DST. The source and destination do
400  not overlap. */
401 # ifndef YYCOPY
402 # if defined __GNUC__ && 1 < __GNUC__
403 # define YYCOPY(Dst, Src, Count) \
404  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
405 # else
406 # define YYCOPY(Dst, Src, Count) \
407  do \
408  { \
409  YYSIZE_T yyi; \
410  for (yyi = 0; yyi < (Count); yyi++) \
411  (Dst)[yyi] = (Src)[yyi]; \
412  } \
413  while (0)
414 # endif
415 # endif
416 #endif /* !YYCOPY_NEEDED */
417 
418 /* YYFINAL -- State number of the termination state. */
419 #define YYFINAL 6
420 /* YYLAST -- Last index in YYTABLE. */
421 #define YYLAST 25
422 
423 /* YYNTOKENS -- Number of terminals. */
424 #define YYNTOKENS 17
425 /* YYNNTS -- Number of nonterminals. */
426 #define YYNNTS 20
427 /* YYNRULES -- Number of rules. */
428 #define YYNRULES 29
429 /* YYNSTATES -- Number of states. */
430 #define YYNSTATES 43
431 
432 #define YYUNDEFTOK 2
433 #define YYMAXUTOK 271
434 
435 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
436  as returned by yylex, with out-of-bounds checking. */
437 #define YYTRANSLATE(YYX) \
438  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
439 
440 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
441  as returned by yylex. */
442 static const yytype_uint8 yytranslate[] =
443 {
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,
471  15, 16
472 };
473 
474 #if YYDEBUG
475  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
476 static const yytype_uint8 yyrline[] =
477 {
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
481 };
482 #endif
483 
484 #if YYDEBUG || YYERROR_VERBOSE || 1
485 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
486  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
487 static const char *const yytname[] =
488 {
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
495 };
496 #endif
497 
498 # ifdef YYPRINT
499 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
500  (internal) symbol number NUM (which must be that of a token). */
501 static const yytype_uint16 yytoknum[] =
502 {
503  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
504  265, 266, 267, 268, 269, 270, 271
505 };
506 # endif
507 
508 #define YYPACT_NINF -13
509 
510 #define yypact_value_is_default(Yystate) \
511  (!!((Yystate) == (-13)))
512 
513 #define YYTABLE_NINF -1
514 
515 #define yytable_value_is_error(Yytable_value) \
516  0
517 
518  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
519  STATE-NUM. */
520 static const yytype_int8 yypact[] =
521 {
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,
526  13, -13, -13
527 };
528 
529  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
530  Performed when YYTABLE does not specify something else to do. Zero
531  means the default is an error. */
532 static const yytype_uint8 yydefact[] =
533 {
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,
538  0, 23, 19
539 };
540 
541  /* YYPGOTO[NTERM-NUM]. */
542 static const yytype_int8 yypgoto[] =
543 {
544  -13, -13, -13, -13, -13, -13, 15, -8, -13, -13,
545  -13, -12, -13, -13, -13, -13, -13, -13, -11, -13
546 };
547 
548  /* YYDEFGOTO[NTERM-NUM]. */
549 static const yytype_int8 yydefgoto[] =
550 {
551  -1, 2, 3, 4, 5, 18, 9, 15, 16, 27,
552  33, 8, 11, 26, 30, 32, 37, 40, 10, 19
553 };
554 
555  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
556  positive, shift that token. If negative, reduce the rule whose
557  number is the opposite. If YYTABLE_NINF, syntax error. */
558 static const yytype_uint8 yytable[] =
559 {
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
563 };
564 
565 static const yytype_uint8 yycheck[] =
566 {
567  11, 5, 5, 8, 9, 3, 10, 12, 0, 16,
568  14, 15, 15, 12, 7, 12, 27, 6, 13, 9,
569  6, 12, 9, 8, 32, 37
570 };
571 
572  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
573  symbol of state STATE-NUM. */
574 static const yytype_uint8 yystos[] =
575 {
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,
580  34, 28, 9
581 };
582 
583  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
584 static const yytype_uint8 yyr1[] =
585 {
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
589 };
590 
591  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
592 static const yytype_uint8 yyr2[] =
593 {
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
597 };
598 
599 
600 #define yyerrok (yyerrstatus = 0)
601 #define yyclearin (yychar = YYEMPTY)
602 #define YYEMPTY (-2)
603 #define YYEOF 0
604 
605 #define YYACCEPT goto yyacceptlab
606 #define YYABORT goto yyabortlab
607 #define YYERROR goto yyerrorlab
608 
609 
610 #define YYRECOVERING() (!!yyerrstatus)
611 
612 #define YYBACKUP(Token, Value) \
613  do \
614  if (yychar == YYEMPTY) \
615  { \
616  yychar = (Token); \
617  yylval = (Value); \
618  YYPOPSTACK (yylen); \
619  yystate = *yyssp; \
620  goto yybackup; \
621  } \
622  else \
623  { \
624  yyerror (YY_("syntax error: cannot back up")); \
625  YYERROR; \
626  } \
627  while (0)
628 
629 /* Error token number */
630 #define YYTERROR 1
631 #define YYERRCODE 256
632 
633 
634 
635 /* Enable debugging if requested. */
636 #if YYDEBUG
637 
638 # ifndef YYFPRINTF
639 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
640 # define YYFPRINTF fprintf
641 # endif
642 
643 # define YYDPRINTF(Args) \
644 do { \
645  if (yydebug) \
646  YYFPRINTF Args; \
647 } while (0)
648 
649 /* This macro is provided for backward compatibility. */
650 #ifndef YY_LOCATION_PRINT
651 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
652 #endif
653 
654 
655 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
656 do { \
657  if (yydebug) \
658  { \
659  YYFPRINTF (stderr, "%s ", Title); \
660  yy_symbol_print (stderr, \
661  Type, Value); \
662  YYFPRINTF (stderr, "\n"); \
663  } \
664 } while (0)
665 
666 
667 /*-----------------------------------.
668 | Print this symbol's value on YYO. |
669 `-----------------------------------*/
670 
671 static void
672 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
673 {
674  FILE *yyoutput = yyo;
675  YYUSE (yyoutput);
676  if (!yyvaluep)
677  return;
678 # ifdef YYPRINT
679  if (yytype < YYNTOKENS)
680  YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
681 # endif
682  YYUSE (yytype);
683 }
684 
685 
686 /*---------------------------.
687 | Print this symbol on YYO. |
688 `---------------------------*/
689 
690 static void
691 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
692 {
693  YYFPRINTF (yyo, "%s %s (",
694  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
695 
696  yy_symbol_value_print (yyo, yytype, yyvaluep);
697  YYFPRINTF (yyo, ")");
698 }
699 
700 /*------------------------------------------------------------------.
701 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
702 | TOP (included). |
703 `------------------------------------------------------------------*/
704 
705 static void
706 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
707 {
708  YYFPRINTF (stderr, "Stack now");
709  for (; yybottom <= yytop; yybottom++)
710  {
711  int yybot = *yybottom;
712  YYFPRINTF (stderr, " %d", yybot);
713  }
714  YYFPRINTF (stderr, "\n");
715 }
716 
717 # define YY_STACK_PRINT(Bottom, Top) \
718 do { \
719  if (yydebug) \
720  yy_stack_print ((Bottom), (Top)); \
721 } while (0)
722 
723 
724 /*------------------------------------------------.
725 | Report that the YYRULE is going to be reduced. |
726 `------------------------------------------------*/
727 
728 static void
729 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
730 {
731  unsigned long yylno = yyrline[yyrule];
732  int yynrhs = yyr2[yyrule];
733  int yyi;
734  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
735  yyrule - 1, yylno);
736  /* The symbols being reduced. */
737  for (yyi = 0; yyi < yynrhs; yyi++)
738  {
739  YYFPRINTF (stderr, " $%d = ", yyi + 1);
740  yy_symbol_print (stderr,
741  yystos[yyssp[yyi + 1 - yynrhs]],
742  &yyvsp[(yyi + 1) - (yynrhs)]
743  );
744  YYFPRINTF (stderr, "\n");
745  }
746 }
747 
748 # define YY_REDUCE_PRINT(Rule) \
749 do { \
750  if (yydebug) \
751  yy_reduce_print (yyssp, yyvsp, Rule); \
752 } while (0)
753 
754 /* Nonzero means print parse trace. It is left uninitialized so that
755  multiple parsers can coexist. */
756 int yydebug;
757 #else /* !YYDEBUG */
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)
762 #endif /* !YYDEBUG */
763 
764 
765 /* YYINITDEPTH -- initial size of the parser's stacks. */
766 #ifndef YYINITDEPTH
767 # define YYINITDEPTH 200
768 #endif
769 
770 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
771  if the built-in stack extension method is used).
772 
773  Do not make this value too large; the results are undefined if
774  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
775  evaluated with infinite-precision integer arithmetic. */
776 
777 #ifndef YYMAXDEPTH
778 # define YYMAXDEPTH 10000
779 #endif
780 
781 
782 #if YYERROR_VERBOSE
783 
784 # ifndef yystrlen
785 # if defined __GLIBC__ && defined _STRING_H
786 # define yystrlen strlen
787 # else
788 /* Return the length of YYSTR. */
789 static YYSIZE_T
790 yystrlen (const char *yystr)
791 {
792  YYSIZE_T yylen;
793  for (yylen = 0; yystr[yylen]; yylen++)
794  continue;
795  return yylen;
796 }
797 # endif
798 # endif
799 
800 # ifndef yystpcpy
801 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
802 # define yystpcpy stpcpy
803 # else
804 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
805  YYDEST. */
806 static char *
807 yystpcpy (char *yydest, const char *yysrc)
808 {
809  char *yyd = yydest;
810  const char *yys = yysrc;
811 
812  while ((*yyd++ = *yys++) != '\0')
813  continue;
814 
815  return yyd - 1;
816 }
817 # endif
818 # endif
819 
820 # ifndef yytnamerr
821 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
822  quotes and backslashes, so that it's suitable for yyerror. The
823  heuristic is that double-quoting is unnecessary unless the string
824  contains an apostrophe, a comma, or backslash (other than
825  backslash-backslash). YYSTR is taken from yytname. If YYRES is
826  null, do not copy; instead, return the length of what the result
827  would have been. */
828 static YYSIZE_T
829 yytnamerr (char *yyres, const char *yystr)
830 {
831  if (*yystr == '"')
832  {
833  YYSIZE_T yyn = 0;
834  char const *yyp = yystr;
835 
836  for (;;)
837  switch (*++yyp)
838  {
839  case '\'':
840  case ',':
841  goto do_not_strip_quotes;
842 
843  case '\\':
844  if (*++yyp != '\\')
845  goto do_not_strip_quotes;
846  else
847  goto append;
848 
849  append:
850  default:
851  if (yyres)
852  yyres[yyn] = *yyp;
853  yyn++;
854  break;
855 
856  case '"':
857  if (yyres)
858  yyres[yyn] = '\0';
859  return yyn;
860  }
861  do_not_strip_quotes: ;
862  }
863 
864  if (! yyres)
865  return yystrlen (yystr);
866 
867  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
868 }
869 # endif
870 
871 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
872  about the unexpected token YYTOKEN for the state stack whose top is
873  YYSSP.
874 
875  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
876  not large enough to hold the message. In that case, also set
877  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
878  required number of bytes is too large to store. */
879 static int
880 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
881  yytype_int16 *yyssp, int yytoken)
882 {
883  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
884  YYSIZE_T yysize = yysize0;
885  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
886  /* Internationalized format string. */
887  const char *yyformat = YY_NULLPTR;
888  /* Arguments of yyformat. */
889  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
890  /* Number of reported tokens (one for the "unexpected", one per
891  "expected"). */
892  int yycount = 0;
893 
894  /* There are many possibilities here to consider:
895  - If this state is a consistent state with a default action, then
896  the only way this function was invoked is if the default action
897  is an error action. In that case, don't check for expected
898  tokens because there are none.
899  - The only way there can be no lookahead present (in yychar) is if
900  this state is a consistent state with a default action. Thus,
901  detecting the absence of a lookahead is sufficient to determine
902  that there is no unexpected or expected token to report. In that
903  case, just report a simple "syntax error".
904  - Don't assume there isn't a lookahead just because this state is a
905  consistent state with a default action. There might have been a
906  previous inconsistent state, consistent state with a non-default
907  action, or user semantic action that manipulated yychar.
908  - Of course, the expected token list depends on states to have
909  correct lookahead information, and it depends on the parser not
910  to perform extra reductions after fetching a lookahead from the
911  scanner and before detecting a syntax error. Thus, state merging
912  (from LALR or IELR) and default reductions corrupt the expected
913  token list. However, the list is correct for canonical LR with
914  one exception: it will still contain any token that will not be
915  accepted due to an error action in a later state.
916  */
917  if (yytoken != YYEMPTY)
918  {
919  int yyn = yypact[*yyssp];
920  yyarg[yycount++] = yytname[yytoken];
921  if (!yypact_value_is_default (yyn))
922  {
923  /* Start YYX at -YYN if negative to avoid negative indexes in
924  YYCHECK. In other words, skip the first -YYN actions for
925  this state because they are default actions. */
926  int yyxbegin = yyn < 0 ? -yyn : 0;
927  /* Stay within bounds of both yycheck and yytname. */
928  int yychecklim = YYLAST - yyn + 1;
929  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
930  int yyx;
931 
932  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
933  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
934  && !yytable_value_is_error (yytable[yyx + yyn]))
935  {
936  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
937  {
938  yycount = 1;
939  yysize = yysize0;
940  break;
941  }
942  yyarg[yycount++] = yytname[yyx];
943  {
944  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
945  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
946  yysize = yysize1;
947  else
948  return 2;
949  }
950  }
951  }
952  }
953 
954  switch (yycount)
955  {
956 # define YYCASE_(N, S) \
957  case N: \
958  yyformat = S; \
959  break
960  default: /* Avoid compiler warnings. */
961  YYCASE_(0, YY_("syntax error"));
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"));
967 # undef YYCASE_
968  }
969 
970  {
971  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
972  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
973  yysize = yysize1;
974  else
975  return 2;
976  }
977 
978  if (*yymsg_alloc < yysize)
979  {
980  *yymsg_alloc = 2 * yysize;
981  if (! (yysize <= *yymsg_alloc
982  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
983  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
984  return 1;
985  }
986 
987  /* Avoid sprintf, as that infringes on the user's name space.
988  Don't have undefined behavior even if the translation
989  produced a string with the wrong number of "%s"s. */
990  {
991  char *yyp = *yymsg;
992  int yyi = 0;
993  while ((*yyp = *yyformat) != '\0')
994  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
995  {
996  yyp += yytnamerr (yyp, yyarg[yyi++]);
997  yyformat += 2;
998  }
999  else
1000  {
1001  yyp++;
1002  yyformat++;
1003  }
1004  }
1005  return 0;
1006 }
1007 #endif /* YYERROR_VERBOSE */
1008 
1009 /*-----------------------------------------------.
1010 | Release the memory associated to this symbol. |
1011 `-----------------------------------------------*/
1012 
1013 static void
1014 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1015 {
1016  YYUSE (yyvaluep);
1017  if (!yymsg)
1018  yymsg = "Deleting";
1019  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1020 
1022  YYUSE (yytype);
1024 }
1025 
1026 
1027 
1028 
1029 /* The lookahead symbol. */
1031 
1032 /* The semantic value of the lookahead symbol. */
1034 /* Number of syntax errors so far. */
1036 
1037 
1038 /*----------.
1039 | yyparse. |
1040 `----------*/
1041 
1042 int
1043 yyparse (void)
1044 {
1045  int yystate;
1046  /* Number of tokens to shift before error messages enabled. */
1047  int yyerrstatus;
1048 
1049  /* The stacks and their tools:
1050  'yyss': related to states.
1051  'yyvs': related to semantic values.
1052 
1053  Refer to the stacks through separate pointers, to allow yyoverflow
1054  to reallocate them elsewhere. */
1055 
1056  /* The state stack. */
1057  yytype_int16 yyssa[YYINITDEPTH];
1058  yytype_int16 *yyss;
1059  yytype_int16 *yyssp;
1060 
1061  /* The semantic value stack. */
1062  YYSTYPE yyvsa[YYINITDEPTH];
1063  YYSTYPE *yyvs;
1064  YYSTYPE *yyvsp;
1065 
1066  YYSIZE_T yystacksize;
1067 
1068  int yyn;
1069  int yyresult;
1070  /* Lookahead token as an internal (translated) token number. */
1071  int yytoken = 0;
1072  /* The variables used to return semantic value and location from the
1073  action routines. */
1074  YYSTYPE yyval;
1075 
1076 #if YYERROR_VERBOSE
1077  /* Buffer for error messages, and its allocated size. */
1078  char yymsgbuf[128];
1079  char *yymsg = yymsgbuf;
1080  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1081 #endif
1082 
1083 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1084 
1085  /* The number of symbols on the RHS of the reduced rule.
1086  Keep to zero when no symbol should be popped. */
1087  int yylen = 0;
1088 
1089  yyssp = yyss = yyssa;
1090  yyvsp = yyvs = yyvsa;
1091  yystacksize = YYINITDEPTH;
1092 
1093  YYDPRINTF ((stderr, "Starting parse\n"));
1094 
1095  yystate = 0;
1096  yyerrstatus = 0;
1097  yynerrs = 0;
1098  yychar = YYEMPTY; /* Cause a token to be read. */
1099  goto yysetstate;
1100 
1101 
1102 /*------------------------------------------------------------.
1103 | yynewstate -- push a new state, which is found in yystate. |
1104 `------------------------------------------------------------*/
1105 yynewstate:
1106  /* In all cases, when you get here, the value and location stacks
1107  have just been pushed. So pushing a state here evens the stacks. */
1108  yyssp++;
1109 
1110 
1111 /*--------------------------------------------------------------------.
1112 | yynewstate -- set current state (the top of the stack) to yystate. |
1113 `--------------------------------------------------------------------*/
1114 yysetstate:
1115  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1116  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1117  *yyssp = (yytype_int16) yystate;
1118 
1119  if (yyss + yystacksize - 1 <= yyssp)
1120 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1121  goto yyexhaustedlab;
1122 #else
1123  {
1124  /* Get the current used size of the three stacks, in elements. */
1125  YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1126 
1127 # if defined yyoverflow
1128  {
1129  /* Give user a chance to reallocate the stack. Use copies of
1130  these so that the &'s don't force the real ones into
1131  memory. */
1132  YYSTYPE *yyvs1 = yyvs;
1133  yytype_int16 *yyss1 = yyss;
1134 
1135  /* Each stack pointer address is followed by the size of the
1136  data in use in that stack, in bytes. This used to be a
1137  conditional around just the two extra args, but that might
1138  be undefined if yyoverflow is a macro. */
1139  yyoverflow (YY_("memory exhausted"),
1140  &yyss1, yysize * sizeof (*yyssp),
1141  &yyvs1, yysize * sizeof (*yyvsp),
1142  &yystacksize);
1143  yyss = yyss1;
1144  yyvs = yyvs1;
1145  }
1146 # else /* defined YYSTACK_RELOCATE */
1147  /* Extend the stack our own way. */
1148  if (YYMAXDEPTH <= yystacksize)
1149  goto yyexhaustedlab;
1150  yystacksize *= 2;
1151  if (YYMAXDEPTH < yystacksize)
1152  yystacksize = YYMAXDEPTH;
1153 
1154  {
1155  yytype_int16 *yyss1 = yyss;
1156  union yyalloc *yyptr =
1157  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1158  if (! yyptr)
1159  goto yyexhaustedlab;
1160  YYSTACK_RELOCATE (yyss_alloc, yyss);
1161  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1162 # undef YYSTACK_RELOCATE
1163  if (yyss1 != yyssa)
1164  YYSTACK_FREE (yyss1);
1165  }
1166 # endif
1167 
1168  yyssp = yyss + yysize - 1;
1169  yyvsp = yyvs + yysize - 1;
1170 
1171  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1172  (unsigned long) yystacksize));
1173 
1174  if (yyss + yystacksize - 1 <= yyssp)
1175  YYABORT;
1176  }
1177 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1178 
1179  if (yystate == YYFINAL)
1180  YYACCEPT;
1181 
1182  goto yybackup;
1183 
1184 
1185 /*-----------.
1186 | yybackup. |
1187 `-----------*/
1188 yybackup:
1189  /* Do appropriate processing given the current state. Read a
1190  lookahead token if we need one and don't already have one. */
1191 
1192  /* First try to decide what to do without reference to lookahead token. */
1193  yyn = yypact[yystate];
1194  if (yypact_value_is_default (yyn))
1195  goto yydefault;
1196 
1197  /* Not known => get a lookahead token if don't already have one. */
1198 
1199  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1200  if (yychar == YYEMPTY)
1201  {
1202  YYDPRINTF ((stderr, "Reading a token: "));
1203  yychar = yylex ();
1204  }
1205 
1206  if (yychar <= YYEOF)
1207  {
1208  yychar = yytoken = YYEOF;
1209  YYDPRINTF ((stderr, "Now at end of input.\n"));
1210  }
1211  else
1212  {
1213  yytoken = YYTRANSLATE (yychar);
1214  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1215  }
1216 
1217  /* If the proper action on seeing token YYTOKEN is to reduce or to
1218  detect an error, take that action. */
1219  yyn += yytoken;
1220  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1221  goto yydefault;
1222  yyn = yytable[yyn];
1223  if (yyn <= 0)
1224  {
1225  if (yytable_value_is_error (yyn))
1226  goto yyerrlab;
1227  yyn = -yyn;
1228  goto yyreduce;
1229  }
1230 
1231  /* Count tokens shifted since error; after three, turn off error
1232  status. */
1233  if (yyerrstatus)
1234  yyerrstatus--;
1235 
1236  /* Shift the lookahead token. */
1237  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1238 
1239  /* Discard the shifted token. */
1240  yychar = YYEMPTY;
1241 
1242  yystate = yyn;
1244  *++yyvsp = yylval;
1246  goto yynewstate;
1247 
1248 
1249 /*-----------------------------------------------------------.
1250 | yydefault -- do the default action for the current state. |
1251 `-----------------------------------------------------------*/
1252 yydefault:
1253  yyn = yydefact[yystate];
1254  if (yyn == 0)
1255  goto yyerrlab;
1256  goto yyreduce;
1257 
1258 
1259 /*-----------------------------.
1260 | yyreduce -- do a reduction. |
1261 `-----------------------------*/
1262 yyreduce:
1263  /* yyn is the number of a rule to reduce with. */
1264  yylen = yyr2[yyn];
1265 
1266  /* If YYLEN is nonzero, implement the default value of the action:
1267  '$$ = $1'.
1268 
1269  Otherwise, the following line sets YYVAL to garbage.
1270  This behavior is undocumented and Bison
1271  users should not rely upon it. Assigning to YYVAL
1272  unconditionally makes the parser a bit smaller, and it avoids a
1273  GCC warning that YYVAL may be used uninitialized. */
1274  yyval = yyvsp[1-yylen];
1275 
1276 
1277  YY_REDUCE_PRINT (yyn);
1278  switch (yyn)
1279  {
1280  case 4:
1281 #line 38 "parser.y"
1282  { xml_parser.stack.push_back(&xml_parser.parse_tree.xml); }
1283 #line 1284 "xml_y.tab.cpp"
1284  break;
1285 
1286  case 5:
1287 #line 40 "parser.y"
1288  { xml_parser.stack.pop_back(); }
1289 #line 1290 "xml_y.tab.cpp"
1290  break;
1291 
1292  case 10:
1293 #line 51 "parser.y"
1294  { free((yyvsp[0].s)); }
1295 #line 1296 "xml_y.tab.cpp"
1296  break;
1297 
1298  case 12:
1299 #line 57 "parser.y"
1300  { free((yyvsp[0].s)); xml_parser.stack.push_back(&xml_parser.parse_tree.xml); }
1301 #line 1302 "xml_y.tab.cpp"
1302  break;
1303 
1304  case 13:
1305 #line 59 "parser.y"
1306  { xml_parser.stack.pop_back(); }
1307 #line 1308 "xml_y.tab.cpp"
1308  break;
1309 
1310  case 15:
1311 #line 64 "parser.y"
1312  { xml_parser.current().name=(yyvsp[0].s);
1313  free((yyvsp[0].s));
1314  }
1315 #line 1316 "xml_y.tab.cpp"
1316  break;
1317 
1318  case 17:
1319 #line 72 "parser.y"
1320  { }
1321 #line 1322 "xml_y.tab.cpp"
1322  break;
1323 
1324  case 18:
1325 #line 73 "parser.y"
1326  { }
1327 #line 1328 "xml_y.tab.cpp"
1328  break;
1329 
1330  case 19:
1331 #line 74 "parser.y"
1332  { free((yyvsp[-1].s)); }
1333 #line 1334 "xml_y.tab.cpp"
1334  break;
1335 
1336  case 20:
1337 #line 78 "parser.y"
1338  { xml_parser.current().data+=xmlt::unescape((yyvsp[0].s)); free((yyvsp[0].s)); }
1339 #line 1340 "xml_y.tab.cpp"
1340  break;
1341 
1342  case 22:
1343 #line 81 "parser.y"
1344  { xml_parser.new_level(); }
1345 #line 1346 "xml_y.tab.cpp"
1346  break;
1347 
1348  case 23:
1349 #line 83 "parser.y"
1350  { xml_parser.stack.pop_back(); }
1351 #line 1352 "xml_y.tab.cpp"
1352  break;
1353 
1354  case 25:
1355 #line 88 "parser.y"
1356  { (yyval.s)=(yyvsp[0].s); }
1357 #line 1358 "xml_y.tab.cpp"
1358  break;
1359 
1360  case 26:
1361 #line 89 "parser.y"
1362  { (yyval.s)=strdup(""); }
1363 #line 1364 "xml_y.tab.cpp"
1364  break;
1365 
1366  case 29:
1367 #line 98 "parser.y"
1369  xmlt::unescape((yyvsp[-2].s)), xmlt::unescape((yyvsp[0].s)));
1370  free((yyvsp[-2].s)); free((yyvsp[0].s));}
1371 #line 1372 "xml_y.tab.cpp"
1372  break;
1373 
1374 
1375 #line 1376 "xml_y.tab.cpp"
1376 
1377  default: break;
1378  }
1379  /* User semantic actions sometimes alter yychar, and that requires
1380  that yytoken be updated with the new translation. We take the
1381  approach of translating immediately before every use of yytoken.
1382  One alternative is translating here after every semantic action,
1383  but that translation would be missed if the semantic action invokes
1384  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1385  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1386  incorrect destructor might then be invoked immediately. In the
1387  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1388  to an incorrect destructor call or verbose syntax error message
1389  before the lookahead is translated. */
1390  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1391 
1392  YYPOPSTACK (yylen);
1393  yylen = 0;
1394  YY_STACK_PRINT (yyss, yyssp);
1395 
1396  *++yyvsp = yyval;
1397 
1398  /* Now 'shift' the result of the reduction. Determine what state
1399  that goes to, based on the state we popped back to and the rule
1400  number reduced by. */
1401  {
1402  const int yylhs = yyr1[yyn] - YYNTOKENS;
1403  const int yyi = yypgoto[yylhs] + *yyssp;
1404  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1405  ? yytable[yyi]
1406  : yydefgoto[yylhs]);
1407  }
1408 
1409  goto yynewstate;
1410 
1411 
1412 /*--------------------------------------.
1413 | yyerrlab -- here on detecting error. |
1414 `--------------------------------------*/
1415 yyerrlab:
1416  /* Make sure we have latest lookahead translation. See comments at
1417  user semantic actions for why this is necessary. */
1418  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1419 
1420  /* If not already recovering from an error, report this error. */
1421  if (!yyerrstatus)
1422  {
1423  ++yynerrs;
1424 #if ! YYERROR_VERBOSE
1425  yyerror (YY_("syntax error"));
1426 #else
1427 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1428  yyssp, yytoken)
1429  {
1430  char const *yymsgp = YY_("syntax error");
1431  int yysyntax_error_status;
1432  yysyntax_error_status = YYSYNTAX_ERROR;
1433  if (yysyntax_error_status == 0)
1434  yymsgp = yymsg;
1435  else if (yysyntax_error_status == 1)
1436  {
1437  if (yymsg != yymsgbuf)
1438  YYSTACK_FREE (yymsg);
1439  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1440  if (!yymsg)
1441  {
1442  yymsg = yymsgbuf;
1443  yymsg_alloc = sizeof yymsgbuf;
1444  yysyntax_error_status = 2;
1445  }
1446  else
1447  {
1448  yysyntax_error_status = YYSYNTAX_ERROR;
1449  yymsgp = yymsg;
1450  }
1451  }
1452  yyerror (yymsgp);
1453  if (yysyntax_error_status == 2)
1454  goto yyexhaustedlab;
1455  }
1456 # undef YYSYNTAX_ERROR
1457 #endif
1458  }
1459 
1460 
1461 
1462  if (yyerrstatus == 3)
1463  {
1464  /* If just tried and failed to reuse lookahead token after an
1465  error, discard it. */
1466 
1467  if (yychar <= YYEOF)
1468  {
1469  /* Return failure if at end of input. */
1470  if (yychar == YYEOF)
1471  YYABORT;
1472  }
1473  else
1474  {
1475  yydestruct ("Error: discarding",
1476  yytoken, &yylval);
1477  yychar = YYEMPTY;
1478  }
1479  }
1480 
1481  /* Else will try to reuse lookahead token after shifting the error
1482  token. */
1483  goto yyerrlab1;
1484 
1485 
1486 /*---------------------------------------------------.
1487 | yyerrorlab -- error raised explicitly by YYERROR. |
1488 `---------------------------------------------------*/
1489 yyerrorlab:
1490  /* Pacify compilers when the user code never invokes YYERROR and the
1491  label yyerrorlab therefore never appears in user code. */
1492  if (0)
1493  YYERROR;
1494 
1495  /* Do not reclaim the symbols of the rule whose action triggered
1496  this YYERROR. */
1497  YYPOPSTACK (yylen);
1498  yylen = 0;
1499  YY_STACK_PRINT (yyss, yyssp);
1500  yystate = *yyssp;
1501  goto yyerrlab1;
1502 
1503 
1504 /*-------------------------------------------------------------.
1505 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1506 `-------------------------------------------------------------*/
1507 yyerrlab1:
1508  yyerrstatus = 3; /* Each real token shifted decrements this. */
1509 
1510  for (;;)
1511  {
1512  yyn = yypact[yystate];
1513  if (!yypact_value_is_default (yyn))
1514  {
1515  yyn += YYTERROR;
1516  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1517  {
1518  yyn = yytable[yyn];
1519  if (0 < yyn)
1520  break;
1521  }
1522  }
1523 
1524  /* Pop the current state because it cannot handle the error token. */
1525  if (yyssp == yyss)
1526  YYABORT;
1527 
1528 
1529  yydestruct ("Error: popping",
1530  yystos[yystate], yyvsp);
1531  YYPOPSTACK (1);
1532  yystate = *yyssp;
1533  YY_STACK_PRINT (yyss, yyssp);
1534  }
1535 
1537  *++yyvsp = yylval;
1539 
1540 
1541  /* Shift the error token. */
1542  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1543 
1544  yystate = yyn;
1545  goto yynewstate;
1546 
1547 
1548 /*-------------------------------------.
1549 | yyacceptlab -- YYACCEPT comes here. |
1550 `-------------------------------------*/
1551 yyacceptlab:
1552  yyresult = 0;
1553  goto yyreturn;
1554 
1555 
1556 /*-----------------------------------.
1557 | yyabortlab -- YYABORT comes here. |
1558 `-----------------------------------*/
1559 yyabortlab:
1560  yyresult = 1;
1561  goto yyreturn;
1562 
1563 
1564 #if !defined yyoverflow || YYERROR_VERBOSE
1565 /*-------------------------------------------------.
1566 | yyexhaustedlab -- memory exhaustion comes here. |
1567 `-------------------------------------------------*/
1568 yyexhaustedlab:
1569  yyerror (YY_("memory exhausted"));
1570  yyresult = 2;
1571  /* Fall through. */
1572 #endif
1573 
1574 
1575 /*-----------------------------------------------------.
1576 | yyreturn -- parsing is finished, return the result. |
1577 `-----------------------------------------------------*/
1578 yyreturn:
1579  if (yychar != YYEMPTY)
1580  {
1581  /* Make sure we have latest lookahead translation. See comments at
1582  user semantic actions for why this is necessary. */
1583  yytoken = YYTRANSLATE (yychar);
1584  yydestruct ("Cleanup: discarding lookahead",
1585  yytoken, &yylval);
1586  }
1587  /* Do not reclaim the symbols of the rule whose action triggered
1588  this YYABORT or YYACCEPT. */
1589  YYPOPSTACK (yylen);
1590  YY_STACK_PRINT (yyss, yyssp);
1591  while (yyssp != yyss)
1592  {
1593  yydestruct ("Cleanup: popping",
1594  yystos[*yyssp], yyvsp);
1595  YYPOPSTACK (1);
1596  }
1597 #ifndef yyoverflow
1598  if (yyss != yyssa)
1599  YYSTACK_FREE (yyss);
1600 #endif
1601 #if YYERROR_VERBOSE
1602  if (yymsg != yymsgbuf)
1603  YYSTACK_FREE (yymsg);
1604 #endif
1605  return yyresult;
1606 }
#define YYNTOKENS
Definition: xml_y.tab.cpp:424
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: xml_y.tab.cpp:759
#define STARTPI
Definition: xml_y.tab.cpp:151
#define YYSYNTAX_ERROR
static const yytype_uint8 yystos[]
Definition: xml_y.tab.cpp:574
#define DATA
Definition: xml_y.tab.cpp:160
#define SLASH
Definition: xml_y.tab.cpp:154
unsigned char yytype_uint8
Definition: xml_y.tab.cpp:195
char * yyxmltext
#define YYSTACK_FREE
Definition: xml_y.tab.cpp:330
#define YYINITDEPTH
Definition: xml_y.tab.cpp:767
#define YYNSTATES
Definition: xml_y.tab.cpp:430
yytokentype
Definition: ansi_c_y.tab.h:50
static size_t yystrlen(const char *yystr)
Definition: xml_y.tab.cpp:790
static char * yystpcpy(char *yydest, const char *yysrc)
Definition: xml_y.tab.cpp:807
static const yytype_uint8 yytable[]
Definition: xml_y.tab.cpp:558
#define yychar
Definition: xml_y.tab.cpp:74
static size_t yytnamerr(char *yyres, const char *yystr)
Definition: xml_y.tab.cpp:829
#define YYMAXDEPTH
Definition: xml_y.tab.cpp:778
xmlt & current()
Definition: xml_parser.h:26
std::string name
Definition: xml.h:30
#define COMMENT
Definition: xml_y.tab.cpp:161
#define VALUE
Definition: xml_y.tab.cpp:159
void free(void *)
signed char yytype_int8
unsigned short yytype_uint16
void * malloc(size_t)
#define YYSIZE_T
Definition: xml_y.tab.cpp:223
void parse_error(const std::string &message, const std::string &before)
Definition: parser.cpp:30
#define YY_NULLPTR
Definition: xml_y.tab.cpp:103
signed char yytype_int8
Definition: xml_y.tab.cpp:201
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: xml_y.tab.cpp:281
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: xml_y.tab.cpp:280
#define yypact_value_is_default(Yystate)
Definition: xml_y.tab.cpp:510
#define yyparse
Definition: xml_y.tab.cpp:67
static const yytype_uint8 yydefact[]
Definition: xml_y.tab.cpp:532
#define NAME
Definition: xml_y.tab.cpp:158
static const yytype_uint8 yyr2[]
Definition: xml_y.tab.cpp:592
#define EQ
Definition: xml_y.tab.cpp:153
#define START
Definition: xml_y.tab.cpp:162
#define YYSTACK_BYTES(N)
Definition: xml_y.tab.cpp:374
int yyxmllex()
The main scanner function which does all the work.
yytype_int16 yyss_alloc
void set_attribute(const std::string &attribute, unsigned value)
Definition: xml.cpp:175
#define YY_ASSERT(E)
Definition: xml_y.tab.cpp:288
#define yyerror
Definition: xml_y.tab.cpp:69
#define ENCODING
Definition: xml_y.tab.cpp:157
unsigned yyvs_alloc
unsigned char yytype_uint8
static const yytype_int8 yypgoto[]
Definition: xml_y.tab.cpp:542
std::string data
Definition: xml.h:30
static std::string unescape(const std::string &s)
takes a string and unescapes any xml style escaped symbols
Definition: xml.cpp:214
#define yylex
Definition: xml_y.tab.cpp:68
xml_parsert xml_parser
Definition: xml_parser.cpp:15
void new_level()
Definition: xml_parser.h:36
#define VERSION
Definition: xml_y.tab.cpp:150
char * s
Definition: xml_y.tab.cpp:169
#define YYTRANSLATE(YYX)
Definition: xml_y.tab.cpp:437
#define YY_STACK_PRINT(Bottom, Top)
Definition: xml_y.tab.cpp:760
#define YYACCEPT
Definition: xml_y.tab.cpp:605
#define yynerrs
Definition: xml_y.tab.cpp:71
static const yytype_int8 yypact[]
Definition: xml_y.tab.cpp:520
int yyxmlparse(void)
Definition: xml_y.tab.cpp:1043
#define YYDPRINTF(Args)
Definition: xml_y.tab.cpp:758
YYSTYPE yyxmllval
Definition: xml_y.tab.cpp:1033
#define STARTXMLDECL
Definition: xml_y.tab.cpp:149
#define yydebug
Definition: xml_y.tab.cpp:70
std::list< xmlt * > stack
Definition: xml_parser.h:24
#define YYABORT
Definition: xml_y.tab.cpp:606
#define END
Definition: xml_y.tab.cpp:156
short yytype_int16
#define YYFINAL
Definition: xml_y.tab.cpp:419
#define YYLAST
Definition: xml_y.tab.cpp:421
#define YYERROR
Definition: xml_y.tab.cpp:607
static const yytype_uint8 yycheck[]
Definition: xml_y.tab.cpp:565
#define YY_(Msgid)
Definition: xml_y.tab.cpp:239
static const yytype_int8 yydefgoto[]
Definition: xml_y.tab.cpp:549
unsigned short yytype_uint16
Definition: xml_y.tab.cpp:207
#define YYSTACK_ALLOC_MAXIMUM
Definition: xml_y.tab.cpp:332
#define YY_REDUCE_PRINT(Rule)
Definition: xml_y.tab.cpp:761
#define CLOSE
Definition: xml_y.tab.cpp:155
#define YYCASE_(N, S)
#define YYEOF
Definition: xml_y.tab.cpp:603
#define YYTERROR
Definition: xml_y.tab.cpp:630
static const char *const yytname[]
Definition: xml_y.tab.cpp:487
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: xml_y.tab.cpp:385
#define YYSTACK_ALLOC
Definition: xml_y.tab.cpp:329
int yyxmlerror(const std::string &error)
Definition: xml_y.tab.cpp:86
static const yytype_uint8 yyr1[]
Definition: xml_y.tab.cpp:584
#define YYUSE(E)
Definition: xml_y.tab.cpp:263
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: xml_y.tab.cpp:1014
static int yysyntax_error(size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: xml_y.tab.cpp:880
static const yytype_uint8 yytranslate[]
Definition: xml_y.tab.cpp:442
short yytype_int16
Definition: xml_y.tab.cpp:213
#define YYEMPTY
Definition: xml_y.tab.cpp:602
#define ENDPI
Definition: xml_y.tab.cpp:152
#define yylval
Definition: xml_y.tab.cpp:73
xml_parse_treet parse_tree
Definition: xml_parser.h:22
#define yytable_value_is_error(Yytable_value)
Definition: xml_y.tab.cpp:515
#define YYPOPSTACK(N)