cprover
xml_y.tab.cpp
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018 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.5"
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 {
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  default: /* Avoid compiler warnings. */
960  YYCASE_(0, YY_("syntax error"));
961  YYCASE_(1, YY_("syntax error, unexpected %s"));
962  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
963  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
964  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
965  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
966 # undef YYCASE_
967  }
968 
969  {
970  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
971  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
972  return 2;
973  yysize = yysize1;
974  }
975 
976  if (*yymsg_alloc < yysize)
977  {
978  *yymsg_alloc = 2 * yysize;
979  if (! (yysize <= *yymsg_alloc
980  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
981  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
982  return 1;
983  }
984 
985  /* Avoid sprintf, as that infringes on the user's name space.
986  Don't have undefined behavior even if the translation
987  produced a string with the wrong number of "%s"s. */
988  {
989  char *yyp = *yymsg;
990  int yyi = 0;
991  while ((*yyp = *yyformat) != '\0')
992  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
993  {
994  yyp += yytnamerr (yyp, yyarg[yyi++]);
995  yyformat += 2;
996  }
997  else
998  {
999  yyp++;
1000  yyformat++;
1001  }
1002  }
1003  return 0;
1004 }
1005 #endif /* YYERROR_VERBOSE */
1006 
1007 /*-----------------------------------------------.
1008 | Release the memory associated to this symbol. |
1009 `-----------------------------------------------*/
1010 
1011 static void
1012 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1013 {
1014  YYUSE (yyvaluep);
1015  if (!yymsg)
1016  yymsg = "Deleting";
1017  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1018 
1020  YYUSE (yytype);
1022 }
1023 
1024 
1025 
1026 
1027 /* The lookahead symbol. */
1029 
1030 /* The semantic value of the lookahead symbol. */
1032 /* Number of syntax errors so far. */
1034 
1035 
1036 /*----------.
1037 | yyparse. |
1038 `----------*/
1039 
1040 int
1041 yyparse (void)
1042 {
1043  int yystate;
1044  /* Number of tokens to shift before error messages enabled. */
1045  int yyerrstatus;
1046 
1047  /* The stacks and their tools:
1048  'yyss': related to states.
1049  'yyvs': related to semantic values.
1050 
1051  Refer to the stacks through separate pointers, to allow yyoverflow
1052  to reallocate them elsewhere. */
1053 
1054  /* The state stack. */
1055  yytype_int16 yyssa[YYINITDEPTH];
1056  yytype_int16 *yyss;
1057  yytype_int16 *yyssp;
1058 
1059  /* The semantic value stack. */
1060  YYSTYPE yyvsa[YYINITDEPTH];
1061  YYSTYPE *yyvs;
1062  YYSTYPE *yyvsp;
1063 
1064  YYSIZE_T yystacksize;
1065 
1066  int yyn;
1067  int yyresult;
1068  /* Lookahead token as an internal (translated) token number. */
1069  int yytoken = 0;
1070  /* The variables used to return semantic value and location from the
1071  action routines. */
1072  YYSTYPE yyval;
1073 
1074 #if YYERROR_VERBOSE
1075  /* Buffer for error messages, and its allocated size. */
1076  char yymsgbuf[128];
1077  char *yymsg = yymsgbuf;
1078  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1079 #endif
1080 
1081 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1082 
1083  /* The number of symbols on the RHS of the reduced rule.
1084  Keep to zero when no symbol should be popped. */
1085  int yylen = 0;
1086 
1087  yyssp = yyss = yyssa;
1088  yyvsp = yyvs = yyvsa;
1089  yystacksize = YYINITDEPTH;
1090 
1091  YYDPRINTF ((stderr, "Starting parse\n"));
1092 
1093  yystate = 0;
1094  yyerrstatus = 0;
1095  yynerrs = 0;
1096  yychar = YYEMPTY; /* Cause a token to be read. */
1097  goto yysetstate;
1098 
1099 /*------------------------------------------------------------.
1100 | yynewstate -- Push a new state, which is found in yystate. |
1101 `------------------------------------------------------------*/
1102  yynewstate:
1103  /* In all cases, when you get here, the value and location stacks
1104  have just been pushed. So pushing a state here evens the stacks. */
1105  yyssp++;
1106 
1107  yysetstate:
1108  *yyssp = yystate;
1109 
1110  if (yyss + yystacksize - 1 <= yyssp)
1111  {
1112  /* Get the current used size of the three stacks, in elements. */
1113  YYSIZE_T yysize = yyssp - yyss + 1;
1114 
1115 #ifdef yyoverflow
1116  {
1117  /* Give user a chance to reallocate the stack. Use copies of
1118  these so that the &'s don't force the real ones into
1119  memory. */
1120  YYSTYPE *yyvs1 = yyvs;
1121  yytype_int16 *yyss1 = yyss;
1122 
1123  /* Each stack pointer address is followed by the size of the
1124  data in use in that stack, in bytes. This used to be a
1125  conditional around just the two extra args, but that might
1126  be undefined if yyoverflow is a macro. */
1127  yyoverflow (YY_("memory exhausted"),
1128  &yyss1, yysize * sizeof (*yyssp),
1129  &yyvs1, yysize * sizeof (*yyvsp),
1130  &yystacksize);
1131 
1132  yyss = yyss1;
1133  yyvs = yyvs1;
1134  }
1135 #else /* no yyoverflow */
1136 # ifndef YYSTACK_RELOCATE
1137  goto yyexhaustedlab;
1138 # else
1139  /* Extend the stack our own way. */
1140  if (YYMAXDEPTH <= yystacksize)
1141  goto yyexhaustedlab;
1142  yystacksize *= 2;
1143  if (YYMAXDEPTH < yystacksize)
1144  yystacksize = YYMAXDEPTH;
1145 
1146  {
1147  yytype_int16 *yyss1 = yyss;
1148  union yyalloc *yyptr =
1149  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1150  if (! yyptr)
1151  goto yyexhaustedlab;
1152  YYSTACK_RELOCATE (yyss_alloc, yyss);
1153  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1154 # undef YYSTACK_RELOCATE
1155  if (yyss1 != yyssa)
1156  YYSTACK_FREE (yyss1);
1157  }
1158 # endif
1159 #endif /* no yyoverflow */
1160 
1161  yyssp = yyss + yysize - 1;
1162  yyvsp = yyvs + yysize - 1;
1163 
1164  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1165  (unsigned long int) yystacksize));
1166 
1167  if (yyss + yystacksize - 1 <= yyssp)
1168  YYABORT;
1169  }
1170 
1171  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1172 
1173  if (yystate == YYFINAL)
1174  YYACCEPT;
1175 
1176  goto yybackup;
1177 
1178 /*-----------.
1179 | yybackup. |
1180 `-----------*/
1181 yybackup:
1182 
1183  /* Do appropriate processing given the current state. Read a
1184  lookahead token if we need one and don't already have one. */
1185 
1186  /* First try to decide what to do without reference to lookahead token. */
1187  yyn = yypact[yystate];
1188  if (yypact_value_is_default (yyn))
1189  goto yydefault;
1190 
1191  /* Not known => get a lookahead token if don't already have one. */
1192 
1193  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1194  if (yychar == YYEMPTY)
1195  {
1196  YYDPRINTF ((stderr, "Reading a token: "));
1197  yychar = yylex ();
1198  }
1199 
1200  if (yychar <= YYEOF)
1201  {
1202  yychar = yytoken = YYEOF;
1203  YYDPRINTF ((stderr, "Now at end of input.\n"));
1204  }
1205  else
1206  {
1207  yytoken = YYTRANSLATE (yychar);
1208  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1209  }
1210 
1211  /* If the proper action on seeing token YYTOKEN is to reduce or to
1212  detect an error, take that action. */
1213  yyn += yytoken;
1214  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1215  goto yydefault;
1216  yyn = yytable[yyn];
1217  if (yyn <= 0)
1218  {
1219  if (yytable_value_is_error (yyn))
1220  goto yyerrlab;
1221  yyn = -yyn;
1222  goto yyreduce;
1223  }
1224 
1225  /* Count tokens shifted since error; after three, turn off error
1226  status. */
1227  if (yyerrstatus)
1228  yyerrstatus--;
1229 
1230  /* Shift the lookahead token. */
1231  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1232 
1233  /* Discard the shifted token. */
1234  yychar = YYEMPTY;
1235 
1236  yystate = yyn;
1238  *++yyvsp = yylval;
1240 
1241  goto yynewstate;
1242 
1243 
1244 /*-----------------------------------------------------------.
1245 | yydefault -- do the default action for the current state. |
1246 `-----------------------------------------------------------*/
1247 yydefault:
1248  yyn = yydefact[yystate];
1249  if (yyn == 0)
1250  goto yyerrlab;
1251  goto yyreduce;
1252 
1253 
1254 /*-----------------------------.
1255 | yyreduce -- Do a reduction. |
1256 `-----------------------------*/
1257 yyreduce:
1258  /* yyn is the number of a rule to reduce with. */
1259  yylen = yyr2[yyn];
1260 
1261  /* If YYLEN is nonzero, implement the default value of the action:
1262  '$$ = $1'.
1263 
1264  Otherwise, the following line sets YYVAL to garbage.
1265  This behavior is undocumented and Bison
1266  users should not rely upon it. Assigning to YYVAL
1267  unconditionally makes the parser a bit smaller, and it avoids a
1268  GCC warning that YYVAL may be used uninitialized. */
1269  yyval = yyvsp[1-yylen];
1270 
1271 
1272  YY_REDUCE_PRINT (yyn);
1273  switch (yyn)
1274  {
1275  case 4:
1276 #line 38 "parser.y" /* yacc.c:1648 */
1277  { xml_parser.stack.push_back(&xml_parser.parse_tree.xml); }
1278 #line 1279 "xml_y.tab.cpp" /* yacc.c:1648 */
1279  break;
1280 
1281  case 5:
1282 #line 40 "parser.y" /* yacc.c:1648 */
1283  { xml_parser.stack.pop_back(); }
1284 #line 1285 "xml_y.tab.cpp" /* yacc.c:1648 */
1285  break;
1286 
1287  case 10:
1288 #line 51 "parser.y" /* yacc.c:1648 */
1289  { free((yyvsp[0].s)); }
1290 #line 1291 "xml_y.tab.cpp" /* yacc.c:1648 */
1291  break;
1292 
1293  case 12:
1294 #line 57 "parser.y" /* yacc.c:1648 */
1295  { free((yyvsp[0].s)); xml_parser.stack.push_back(&xml_parser.parse_tree.xml); }
1296 #line 1297 "xml_y.tab.cpp" /* yacc.c:1648 */
1297  break;
1298 
1299  case 13:
1300 #line 59 "parser.y" /* yacc.c:1648 */
1301  { xml_parser.stack.pop_back(); }
1302 #line 1303 "xml_y.tab.cpp" /* yacc.c:1648 */
1303  break;
1304 
1305  case 15:
1306 #line 64 "parser.y" /* yacc.c:1648 */
1307  { xml_parser.current().name=(yyvsp[0].s);
1308  free((yyvsp[0].s));
1309  }
1310 #line 1311 "xml_y.tab.cpp" /* yacc.c:1648 */
1311  break;
1312 
1313  case 17:
1314 #line 72 "parser.y" /* yacc.c:1648 */
1315  { }
1316 #line 1317 "xml_y.tab.cpp" /* yacc.c:1648 */
1317  break;
1318 
1319  case 18:
1320 #line 73 "parser.y" /* yacc.c:1648 */
1321  { }
1322 #line 1323 "xml_y.tab.cpp" /* yacc.c:1648 */
1323  break;
1324 
1325  case 19:
1326 #line 74 "parser.y" /* yacc.c:1648 */
1327  { free((yyvsp[-1].s)); }
1328 #line 1329 "xml_y.tab.cpp" /* yacc.c:1648 */
1329  break;
1330 
1331  case 20:
1332 #line 78 "parser.y" /* yacc.c:1648 */
1333  { xml_parser.current().data+=xmlt::unescape((yyvsp[0].s)); free((yyvsp[0].s)); }
1334 #line 1335 "xml_y.tab.cpp" /* yacc.c:1648 */
1335  break;
1336 
1337  case 22:
1338 #line 81 "parser.y" /* yacc.c:1648 */
1339  { xml_parser.new_level(); }
1340 #line 1341 "xml_y.tab.cpp" /* yacc.c:1648 */
1341  break;
1342 
1343  case 23:
1344 #line 83 "parser.y" /* yacc.c:1648 */
1345  { xml_parser.stack.pop_back(); }
1346 #line 1347 "xml_y.tab.cpp" /* yacc.c:1648 */
1347  break;
1348 
1349  case 25:
1350 #line 88 "parser.y" /* yacc.c:1648 */
1351  { (yyval.s)=(yyvsp[0].s); }
1352 #line 1353 "xml_y.tab.cpp" /* yacc.c:1648 */
1353  break;
1354 
1355  case 26:
1356 #line 89 "parser.y" /* yacc.c:1648 */
1357  { (yyval.s)=strdup(""); }
1358 #line 1359 "xml_y.tab.cpp" /* yacc.c:1648 */
1359  break;
1360 
1361  case 29:
1362 #line 98 "parser.y" /* yacc.c:1648 */
1364  xmlt::unescape((yyvsp[-2].s)), xmlt::unescape((yyvsp[0].s)));
1365  free((yyvsp[-2].s)); free((yyvsp[0].s));}
1366 #line 1367 "xml_y.tab.cpp" /* yacc.c:1648 */
1367  break;
1368 
1369 
1370 #line 1371 "xml_y.tab.cpp" /* yacc.c:1648 */
1371  default: break;
1372  }
1373  /* User semantic actions sometimes alter yychar, and that requires
1374  that yytoken be updated with the new translation. We take the
1375  approach of translating immediately before every use of yytoken.
1376  One alternative is translating here after every semantic action,
1377  but that translation would be missed if the semantic action invokes
1378  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1379  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1380  incorrect destructor might then be invoked immediately. In the
1381  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1382  to an incorrect destructor call or verbose syntax error message
1383  before the lookahead is translated. */
1384  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1385 
1386  YYPOPSTACK (yylen);
1387  yylen = 0;
1388  YY_STACK_PRINT (yyss, yyssp);
1389 
1390  *++yyvsp = yyval;
1391 
1392  /* Now 'shift' the result of the reduction. Determine what state
1393  that goes to, based on the state we popped back to and the rule
1394  number reduced by. */
1395 
1396  yyn = yyr1[yyn];
1397 
1398  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1399  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1400  yystate = yytable[yystate];
1401  else
1402  yystate = yydefgoto[yyn - YYNTOKENS];
1403 
1404  goto yynewstate;
1405 
1406 
1407 /*--------------------------------------.
1408 | yyerrlab -- here on detecting error. |
1409 `--------------------------------------*/
1410 yyerrlab:
1411  /* Make sure we have latest lookahead translation. See comments at
1412  user semantic actions for why this is necessary. */
1413  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1414 
1415  /* If not already recovering from an error, report this error. */
1416  if (!yyerrstatus)
1417  {
1418  ++yynerrs;
1419 #if ! YYERROR_VERBOSE
1420  yyerror (YY_("syntax error"));
1421 #else
1422 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1423  yyssp, yytoken)
1424  {
1425  char const *yymsgp = YY_("syntax error");
1426  int yysyntax_error_status;
1427  yysyntax_error_status = YYSYNTAX_ERROR;
1428  if (yysyntax_error_status == 0)
1429  yymsgp = yymsg;
1430  else if (yysyntax_error_status == 1)
1431  {
1432  if (yymsg != yymsgbuf)
1433  YYSTACK_FREE (yymsg);
1434  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1435  if (!yymsg)
1436  {
1437  yymsg = yymsgbuf;
1438  yymsg_alloc = sizeof yymsgbuf;
1439  yysyntax_error_status = 2;
1440  }
1441  else
1442  {
1443  yysyntax_error_status = YYSYNTAX_ERROR;
1444  yymsgp = yymsg;
1445  }
1446  }
1447  yyerror (yymsgp);
1448  if (yysyntax_error_status == 2)
1449  goto yyexhaustedlab;
1450  }
1451 # undef YYSYNTAX_ERROR
1452 #endif
1453  }
1454 
1455 
1456 
1457  if (yyerrstatus == 3)
1458  {
1459  /* If just tried and failed to reuse lookahead token after an
1460  error, discard it. */
1461 
1462  if (yychar <= YYEOF)
1463  {
1464  /* Return failure if at end of input. */
1465  if (yychar == YYEOF)
1466  YYABORT;
1467  }
1468  else
1469  {
1470  yydestruct ("Error: discarding",
1471  yytoken, &yylval);
1472  yychar = YYEMPTY;
1473  }
1474  }
1475 
1476  /* Else will try to reuse lookahead token after shifting the error
1477  token. */
1478  goto yyerrlab1;
1479 
1480 
1481 /*---------------------------------------------------.
1482 | yyerrorlab -- error raised explicitly by YYERROR. |
1483 `---------------------------------------------------*/
1484 yyerrorlab:
1485 
1486  /* Pacify compilers like GCC when the user code never invokes
1487  YYERROR and the label yyerrorlab therefore never appears in user
1488  code. */
1489  if (/*CONSTCOND*/ 0)
1490  goto yyerrorlab;
1491 
1492  /* Do not reclaim the symbols of the rule whose action triggered
1493  this YYERROR. */
1494  YYPOPSTACK (yylen);
1495  yylen = 0;
1496  YY_STACK_PRINT (yyss, yyssp);
1497  yystate = *yyssp;
1498  goto yyerrlab1;
1499 
1500 
1501 /*-------------------------------------------------------------.
1502 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1503 `-------------------------------------------------------------*/
1504 yyerrlab1:
1505  yyerrstatus = 3; /* Each real token shifted decrements this. */
1506 
1507  for (;;)
1508  {
1509  yyn = yypact[yystate];
1510  if (!yypact_value_is_default (yyn))
1511  {
1512  yyn += YYTERROR;
1513  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1514  {
1515  yyn = yytable[yyn];
1516  if (0 < yyn)
1517  break;
1518  }
1519  }
1520 
1521  /* Pop the current state because it cannot handle the error token. */
1522  if (yyssp == yyss)
1523  YYABORT;
1524 
1525 
1526  yydestruct ("Error: popping",
1527  yystos[yystate], yyvsp);
1528  YYPOPSTACK (1);
1529  yystate = *yyssp;
1530  YY_STACK_PRINT (yyss, yyssp);
1531  }
1532 
1534  *++yyvsp = yylval;
1536 
1537 
1538  /* Shift the error token. */
1539  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1540 
1541  yystate = yyn;
1542  goto yynewstate;
1543 
1544 
1545 /*-------------------------------------.
1546 | yyacceptlab -- YYACCEPT comes here. |
1547 `-------------------------------------*/
1548 yyacceptlab:
1549  yyresult = 0;
1550  goto yyreturn;
1551 
1552 /*-----------------------------------.
1553 | yyabortlab -- YYABORT comes here. |
1554 `-----------------------------------*/
1555 yyabortlab:
1556  yyresult = 1;
1557  goto yyreturn;
1558 
1559 #if !defined yyoverflow || YYERROR_VERBOSE
1560 /*-------------------------------------------------.
1561 | yyexhaustedlab -- memory exhaustion comes here. |
1562 `-------------------------------------------------*/
1563 yyexhaustedlab:
1564  yyerror (YY_("memory exhausted"));
1565  yyresult = 2;
1566  /* Fall through. */
1567 #endif
1568 
1569 yyreturn:
1570  if (yychar != YYEMPTY)
1571  {
1572  /* Make sure we have latest lookahead translation. See comments at
1573  user semantic actions for why this is necessary. */
1574  yytoken = YYTRANSLATE (yychar);
1575  yydestruct ("Cleanup: discarding lookahead",
1576  yytoken, &yylval);
1577  }
1578  /* Do not reclaim the symbols of the rule whose action triggered
1579  this YYABORT or YYACCEPT. */
1580  YYPOPSTACK (yylen);
1581  YY_STACK_PRINT (yyss, yyssp);
1582  while (yyssp != yyss)
1583  {
1584  yydestruct ("Cleanup: popping",
1585  yystos[*yyssp], yyvsp);
1586  YYPOPSTACK (1);
1587  }
1588 #ifndef yyoverflow
1589  if (yyss != yyssa)
1590  YYSTACK_FREE (yyss);
1591 #endif
1592 #if YYERROR_VERBOSE
1593  if (yymsg != yymsgbuf)
1594  YYSTACK_FREE (yymsg);
1595 #endif
1596  return yyresult;
1597 }
#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.
yytype_int16 yyss_alloc
void set_attribute(const std::string &attribute, unsigned value)
Definition: xml.cpp:175
#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:214
#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:1041
#define YYDPRINTF(Args)
Definition: xml_y.tab.cpp:760
YYSTYPE yyxmllval
Definition: xml_y.tab.cpp:1031
#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:1012
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)