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