-/* A Bison parser, made by GNU Bison 2.3. */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
- simplifying the original so-called "semantic" parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "2.3"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 0
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names. */
-#define yyparse xmlParserparse
-#define yylex xmlParserlex
-#define yyerror xmlParsererror
-#define yylval xmlParserlval
-#define yychar xmlParserchar
-#define yydebug xmlParserdebug
-#define yynerrs xmlParsernerrs
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NAME = 258,
- STRING_TOKEN = 259
- };
-#endif
-/* Tokens. */
-#define NAME 258
-#define STRING_TOKEN 259
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 8 "xml.y"
-
-
-
-#include <stdio.h>
-
-/* Some addn'l includes, necessary but not included by the
- bison generated code.
-*/
-
-#include <stdlib.h>
-
-/* prototypes for the parser callbacks.
-*/
-
-#include "xml_t.h"
-
-
-extern xml_t *xml_result;
-
-extern int xmlParserdebug;
-extern void xmlParsererror(char *s);
-extern int xmlParserlex();
-
-
-#define YYDEBUG 1
-
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 39 "xml.y"
-{
- int intval;
- double floatval;
- char *strval;
- int subtok;
- struct name_val_pair_t *nvpt;
- struct name_val_list_t *nvpl;
- struct tag_t *tg_t;
- struct xml_list_t *xlist_t;
- struct xml_t *x_t;
-}
-/* Line 193 of yacc.c. */
-#line 152 "xml.tab.cc"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 216 of yacc.c. */
-#line 165 "xml.tab.cc"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-# define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# else
-# define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if YYENABLE_NLS
-# if ENABLE_NLS
-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(msgid) msgid
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
-#else
-# define YYUSE(e) /* empty */
-#endif
-
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
-#endif
-{
- return i;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# elif defined __BUILTIN_VA_ARG_INCR
-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-# elif defined _AIX
-# define YYSTACK_ALLOC __alloca
-# elif defined _MSC_VER
-# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-# define alloca _alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
- && ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
-# endif
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
- && (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 6
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 25
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 9
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 9
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 14
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 26
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 259
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const yytype_uint8 yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 6, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 5, 8, 7, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint8 yyprhs[] =
-{
- 0, 0, 3, 5, 9, 12, 18, 23, 28, 30,
- 33, 35, 36, 38, 41
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 10, 0, -1, 11, -1, 12, 14, 13, -1, 12,
- 13, -1, 5, 3, 15, 6, 7, -1, 5, 3,
- 15, 7, -1, 5, 6, 3, 7, -1, 11, -1,
- 14, 11, -1, 16, -1, -1, 17, -1, 16, 17,
- -1, 3, 8, 4, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint8 yyrline[] =
-{
- 0, 65, 65, 69, 70, 71, 75, 79, 84, 85,
- 89, 90, 94, 95, 99
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "'<'", "'/'",
- "'>'", "'='", "$accept", "parse_result", "resource", "start_tag",
- "end_tag", "xml_list", "opt_val_list", "val_list", "val", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 yytoknum[] =
-{
- 0, 256, 257, 258, 259, 60, 47, 62, 61
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 9, 10, 11, 11, 11, 12, 13, 14, 14,
- 15, 15, 16, 16, 17
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 3, 2, 5, 4, 4, 1, 2,
- 1, 0, 1, 2, 3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
-{
- 0, 0, 0, 2, 0, 11, 1, 0, 8, 4,
- 0, 0, 0, 10, 12, 0, 9, 3, 0, 0,
- 6, 13, 0, 14, 5, 7
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int8 yydefgoto[] =
-{
- -1, 2, 3, 4, 9, 10, 12, 13, 14
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -5
-static const yytype_int8 yypact[] =
-{
- -3, 0, 5, -5, 4, 7, -5, -2, -5, -5,
- 4, 3, 1, 7, -5, 9, -5, -5, 10, 6,
- -5, -5, 8, -5, -5, -5
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
-{
- -5, -5, -4, -5, 11, -5, -5, -5, 12
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
-{
- 8, 5, 1, 5, 15, 6, 16, 19, 20, 7,
- 11, 18, 22, 24, 23, 25, 0, 0, 0, 0,
- 0, 17, 0, 0, 0, 21
-};
-
-static const yytype_int8 yycheck[] =
-{
- 4, 3, 5, 3, 6, 0, 10, 6, 7, 5,
- 3, 8, 3, 7, 4, 7, -1, -1, -1, -1,
- -1, 10, -1, -1, -1, 13
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
-{
- 0, 5, 10, 11, 12, 3, 0, 5, 11, 13,
- 14, 3, 15, 16, 17, 6, 11, 13, 8, 6,
- 7, 17, 3, 4, 7, 7
-};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-
-#define YYFAIL goto yyerrlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- if (!yyvaluep)
- return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
-#endif
-{
- int yynrhs = yyr2[yyrule];
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
- /* The symbols being reduced. */
- for (yyi = 0; yyi < yynrhs; yyi++)
- {
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
- }
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-\f
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- YYSIZE_T yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
- }
-}
-#endif /* YYERROR_VERBOSE */
-\f
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- YYUSE (yyvaluep);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-\f
-
-/* Prevent warnings from -Wmissing-prototypes. */
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol. */
-int yychar;
-
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
- /* The number of symbols on the RHS of the reduced rule.
- Keep to zero when no symbol should be popped. */
- int yylen = 0;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. So pushing a state here evens the stacks. */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
- /* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
-
- /* First try to decide what to do without reference to look-ahead token. */
- yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
- goto yydefault;
-
- /* Not known => get a look-ahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- yystate = yyn;
- *++yyvsp = yylval;
-
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 65 "xml.y"
- {xml_result = (yyvsp[(1) - (1)].x_t);;}
- break;
-
- case 3:
-#line 69 "xml.y"
- {(yyval.x_t) = new xml_t((yyvsp[(1) - (3)].tg_t),(yyvsp[(2) - (3)].xlist_t),(yyvsp[(3) - (3)].strval));;}
- break;
-
- case 4:
-#line 70 "xml.y"
- {(yyval.x_t)=new xml_t((yyvsp[(1) - (2)].tg_t),(yyvsp[(2) - (2)].strval));;}
- break;
-
- case 5:
-#line 71 "xml.y"
- {(yyval.x_t)=new xml_t((yyvsp[(2) - (5)].strval),(yyvsp[(3) - (5)].nvpl));;}
- break;
-
- case 6:
-#line 75 "xml.y"
- {(yyval.tg_t) = new tag_t((yyvsp[(2) - (4)].strval), (yyvsp[(3) - (4)].nvpl));;}
- break;
-
- case 7:
-#line 79 "xml.y"
- {(yyval.strval)=(yyvsp[(3) - (4)].strval);;}
- break;
-
- case 8:
-#line 84 "xml.y"
- {(yyval.xlist_t)=new xml_list_t((yyvsp[(1) - (1)].x_t));;}
- break;
-
- case 9:
-#line 85 "xml.y"
- {(yyval.xlist_t)=(yyvsp[(1) - (2)].xlist_t)->append((yyvsp[(2) - (2)].x_t));;}
- break;
-
- case 10:
-#line 89 "xml.y"
- {(yyval.nvpl)=(yyvsp[(1) - (1)].nvpl);;}
- break;
-
- case 11:
-#line 90 "xml.y"
- {(yyval.nvpl)=new name_val_list_t();;}
- break;
-
- case 12:
-#line 94 "xml.y"
- {(yyval.nvpl) = new name_val_list_t((yyvsp[(1) - (1)].nvpt));;}
- break;
-
- case 13:
-#line 95 "xml.y"
- {(yyval.nvpl) = (yyvsp[(1) - (2)].nvpl)->append((yyvsp[(2) - (2)].nvpt));;}
- break;
-
- case 14:
-#line 99 "xml.y"
- {(yyval.nvpt) = new name_val_pair_t((yyvsp[(1) - (3)].strval),(yyvsp[(3) - (3)].strval));;}
- break;
-
-
-/* Line 1267 of yacc.c. */
-#line 1428 "xml.tab.cc"
- default: break;
- }
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
-#else
- {
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
- }
-#endif
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
- else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
- }
-
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
- yystate = *yyssp;
- goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
-
- yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
- YYPOPSTACK (1);
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- *++yyvsp = yylval;
-
-
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- YYPOPSTACK (yylen);
- YY_STACK_PRINT (yyss, yyssp);
- while (yyssp != yyss)
- {
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK (1);
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
-#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
-}
-
-
-#line 106 "xml.y"
-
-
-
-
+/* A Bison parser, made by GNU Bison 2.3. */\r
+\r
+/* Skeleton implementation for Bison's Yacc-like parsers in C\r
+\r
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006\r
+ Free Software Foundation, Inc.\r
+\r
+ This program is free software; you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation; either version 2, or (at your option)\r
+ any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,\r
+ Boston, MA 02110-1301, USA. */\r
+\r
+/* As a special exception, you may create a larger work that contains\r
+ part or all of the Bison parser skeleton and distribute that work\r
+ under terms of your choice, so long as that work isn't itself a\r
+ parser generator using the skeleton or a modified version thereof\r
+ as a parser skeleton. Alternatively, if you modify or redistribute\r
+ the parser skeleton itself, you may (at your option) remove this\r
+ special exception, which will cause the skeleton and the resulting\r
+ Bison output files to be licensed under the GNU General Public\r
+ License without this special exception.\r
+\r
+ This special exception was added by the Free Software Foundation in\r
+ version 2.2 of Bison. */\r
+\r
+/* C LALR(1) parser skeleton written by Richard Stallman, by\r
+ simplifying the original so-called "semantic" parser. */\r
+\r
+/* All symbols defined below should begin with yy or YY, to avoid\r
+ infringing on user name space. This should be done even for local\r
+ variables, as they might otherwise be expanded by user macros.\r
+ There are some unavoidable exceptions within include files to\r
+ define necessary library symbols; they are noted "INFRINGES ON\r
+ USER NAME SPACE" below. */\r
+\r
+/* Identify Bison output. */\r
+#define YYBISON 1\r
+\r
+/* Bison version. */\r
+#define YYBISON_VERSION "2.3"\r
+\r
+/* Skeleton name. */\r
+#define YYSKELETON_NAME "yacc.c"\r
+\r
+/* Pure parsers. */\r
+#define YYPURE 0\r
+\r
+/* Using locations. */\r
+#define YYLSP_NEEDED 0\r
+\r
+/* Substitute the variable and function names. */\r
+#define yyparse xmlParserparse\r
+#define yylex xmlParserlex\r
+#define yyerror xmlParsererror\r
+#define yylval xmlParserlval\r
+#define yychar xmlParserchar\r
+#define yydebug xmlParserdebug\r
+#define yynerrs xmlParsernerrs\r
+\r
+\r
+/* Tokens. */\r
+#ifndef YYTOKENTYPE\r
+# define YYTOKENTYPE\r
+ /* Put the tokens into the symbol table, so that GDB and other debuggers\r
+ know about them. */\r
+ enum yytokentype {\r
+ NAME = 258,\r
+ STRING_TOKEN = 259\r
+ };\r
+#endif\r
+/* Tokens. */\r
+#define NAME 258\r
+#define STRING_TOKEN 259\r
+\r
+\r
+\r
+\r
+/* Copy the first part of user declarations. */\r
+#line 8 "xml.y"\r
+\r
+\r
+\r
+#include <stdio.h>\r
+\r
+/* Some addn'l includes, necessary but not included by the\r
+ bison generated code.\r
+*/\r
+\r
+#include <stdlib.h>\r
+\r
+/* prototypes for the parser callbacks.\r
+*/\r
+\r
+#include "xml_t.h"\r
+\r
+\r
+extern xml_t *xml_result;\r
+\r
+extern int xmlParserdebug;\r
+extern void xmlParsererror(char *s);\r
+extern int xmlParserlex();\r
+\r
+\r
+#define YYDEBUG 1\r
+\r
+\r
+\r
+/* Enabling traces. */\r
+#ifndef YYDEBUG\r
+# define YYDEBUG 0\r
+#endif\r
+\r
+/* Enabling verbose error messages. */\r
+#ifdef YYERROR_VERBOSE\r
+# undef YYERROR_VERBOSE\r
+# define YYERROR_VERBOSE 1\r
+#else\r
+# define YYERROR_VERBOSE 0\r
+#endif\r
+\r
+/* Enabling the token table. */\r
+#ifndef YYTOKEN_TABLE\r
+# define YYTOKEN_TABLE 0\r
+#endif\r
+\r
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED\r
+typedef union YYSTYPE\r
+#line 39 "xml.y"\r
+{\r
+ int intval;\r
+ double floatval;\r
+ char *strval;\r
+ int subtok;\r
+ struct name_val_pair_t *nvpt;\r
+ struct name_val_list_t *nvpl;\r
+ struct tag_t *tg_t;\r
+ struct xml_list_t *xlist_t;\r
+ struct xml_t *x_t;\r
+}\r
+/* Line 193 of yacc.c. */\r
+#line 152 "xml.tab.cc"\r
+ YYSTYPE;\r
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */\r
+# define YYSTYPE_IS_DECLARED 1\r
+# define YYSTYPE_IS_TRIVIAL 1\r
+#endif\r
+\r
+\r
+\r
+/* Copy the second part of user declarations. */\r
+\r
+\r
+/* Line 216 of yacc.c. */\r
+#line 165 "xml.tab.cc"\r
+\r
+#ifdef short\r
+# undef short\r
+#endif\r
+\r
+#ifdef YYTYPE_UINT8\r
+typedef YYTYPE_UINT8 yytype_uint8;\r
+#else\r
+typedef unsigned char yytype_uint8;\r
+#endif\r
+\r
+#ifdef YYTYPE_INT8\r
+typedef YYTYPE_INT8 yytype_int8;\r
+#elif (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+typedef signed char yytype_int8;\r
+#else\r
+typedef short int yytype_int8;\r
+#endif\r
+\r
+#ifdef YYTYPE_UINT16\r
+typedef YYTYPE_UINT16 yytype_uint16;\r
+#else\r
+typedef unsigned short int yytype_uint16;\r
+#endif\r
+\r
+#ifdef YYTYPE_INT16\r
+typedef YYTYPE_INT16 yytype_int16;\r
+#else\r
+typedef short int yytype_int16;\r
+#endif\r
+\r
+#ifndef YYSIZE_T\r
+# ifdef __SIZE_TYPE__\r
+# define YYSIZE_T __SIZE_TYPE__\r
+# elif defined size_t\r
+# define YYSIZE_T size_t\r
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */\r
+# define YYSIZE_T size_t\r
+# else\r
+# define YYSIZE_T unsigned int\r
+# endif\r
+#endif\r
+\r
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)\r
+\r
+#ifndef YY_\r
+# if YYENABLE_NLS\r
+# if ENABLE_NLS\r
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */\r
+# define YY_(msgid) dgettext ("bison-runtime", msgid)\r
+# endif\r
+# endif\r
+# ifndef YY_\r
+# define YY_(msgid) msgid\r
+# endif\r
+#endif\r
+\r
+/* Suppress unused-variable warnings by "using" E. */\r
+#if ! defined lint || defined __GNUC__\r
+# define YYUSE(e) ((void) (e))\r
+#else\r
+# define YYUSE(e) /* empty */\r
+#endif\r
+\r
+/* Identity function, used to suppress warnings about constant conditions. */\r
+#ifndef lint\r
+# define YYID(n) (n)\r
+#else\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static int\r
+YYID (int i)\r
+#else\r
+static int\r
+YYID (i)\r
+ int i;\r
+#endif\r
+{\r
+ return i;\r
+}\r
+#endif\r
+\r
+#if ! defined yyoverflow || YYERROR_VERBOSE\r
+\r
+/* The parser invokes alloca or malloc; define the necessary symbols. */\r
+\r
+# ifdef YYSTACK_USE_ALLOCA\r
+# if YYSTACK_USE_ALLOCA\r
+# ifdef __GNUC__\r
+# define YYSTACK_ALLOC __builtin_alloca\r
+# elif defined __BUILTIN_VA_ARG_INCR\r
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */\r
+# elif defined _AIX\r
+# define YYSTACK_ALLOC __alloca\r
+# elif defined _MSC_VER\r
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */\r
+# define alloca _alloca\r
+# else\r
+# define YYSTACK_ALLOC alloca\r
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */\r
+# ifndef _STDLIB_H\r
+# define _STDLIB_H 1\r
+# endif\r
+# endif\r
+# endif\r
+# endif\r
+# endif\r
+\r
+# ifdef YYSTACK_ALLOC\r
+ /* Pacify GCC's `empty if-body' warning. */\r
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))\r
+# ifndef YYSTACK_ALLOC_MAXIMUM\r
+ /* The OS might guarantee only one guard page at the bottom of the stack,\r
+ and a page size can be as small as 4096 bytes. So we cannot safely\r
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number\r
+ to allow for a few compiler-allocated temporary stack slots. */\r
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */\r
+# endif\r
+# else\r
+# define YYSTACK_ALLOC YYMALLOC\r
+# define YYSTACK_FREE YYFREE\r
+# ifndef YYSTACK_ALLOC_MAXIMUM\r
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM\r
+# endif\r
+# if (defined __cplusplus && ! defined _STDLIB_H \\r
+ && ! ((defined YYMALLOC || defined malloc) \\r
+ && (defined YYFREE || defined free)))\r
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */\r
+# ifndef _STDLIB_H\r
+# define _STDLIB_H 1\r
+# endif\r
+# endif\r
+# ifndef YYMALLOC\r
+# define YYMALLOC malloc\r
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */\r
+# endif\r
+# endif\r
+# ifndef YYFREE\r
+# define YYFREE free\r
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+void free (void *); /* INFRINGES ON USER NAME SPACE */\r
+# endif\r
+# endif\r
+# endif\r
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */\r
+\r
+\r
+#if (! defined yyoverflow \\r
+ && (! defined __cplusplus \\r
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))\r
+\r
+/* A type that is properly aligned for any stack member. */\r
+union yyalloc\r
+{\r
+ yytype_int16 yyss;\r
+ YYSTYPE yyvs;\r
+ };\r
+\r
+/* The size of the maximum gap between one aligned stack and the next. */\r
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)\r
+\r
+/* The size of an array large to enough to hold all stacks, each with\r
+ N elements. */\r
+# define YYSTACK_BYTES(N) \\r
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \\r
+ + YYSTACK_GAP_MAXIMUM)\r
+\r
+/* Copy COUNT objects from FROM to TO. The source and destination do\r
+ not overlap. */\r
+# ifndef YYCOPY\r
+# if defined __GNUC__ && 1 < __GNUC__\r
+# define YYCOPY(To, From, Count) \\r
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))\r
+# else\r
+# define YYCOPY(To, From, Count) \\r
+ do \\r
+ { \\r
+ YYSIZE_T yyi; \\r
+ for (yyi = 0; yyi < (Count); yyi++) \\r
+ (To)[yyi] = (From)[yyi]; \\r
+ } \\r
+ while (YYID (0))\r
+# endif\r
+# endif\r
+\r
+/* Relocate STACK from its old location to the new one. The\r
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of\r
+ elements in the stack, and YYPTR gives the new location of the\r
+ stack. Advance YYPTR to a properly aligned location for the next\r
+ stack. */\r
+# define YYSTACK_RELOCATE(Stack) \\r
+ do \\r
+ { \\r
+ YYSIZE_T yynewbytes; \\r
+ YYCOPY (&yyptr->Stack, Stack, yysize); \\r
+ Stack = &yyptr->Stack; \\r
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \\r
+ yyptr += yynewbytes / sizeof (*yyptr); \\r
+ } \\r
+ while (YYID (0))\r
+\r
+#endif\r
+\r
+/* YYFINAL -- State number of the termination state. */\r
+#define YYFINAL 6\r
+/* YYLAST -- Last index in YYTABLE. */\r
+#define YYLAST 25\r
+\r
+/* YYNTOKENS -- Number of terminals. */\r
+#define YYNTOKENS 9\r
+/* YYNNTS -- Number of nonterminals. */\r
+#define YYNNTS 9\r
+/* YYNRULES -- Number of rules. */\r
+#define YYNRULES 14\r
+/* YYNRULES -- Number of states. */\r
+#define YYNSTATES 26\r
+\r
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */\r
+#define YYUNDEFTOK 2\r
+#define YYMAXUTOK 259\r
+\r
+#define YYTRANSLATE(YYX) \\r
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)\r
+\r
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */\r
+static const yytype_uint8 yytranslate[] =\r
+{\r
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 6, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 5, 8, 7, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\r
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4\r
+};\r
+\r
+#if YYDEBUG\r
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in\r
+ YYRHS. */\r
+static const yytype_uint8 yyprhs[] =\r
+{\r
+ 0, 0, 3, 5, 9, 12, 18, 23, 28, 30,\r
+ 33, 35, 36, 38, 41\r
+};\r
+\r
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */\r
+static const yytype_int8 yyrhs[] =\r
+{\r
+ 10, 0, -1, 11, -1, 12, 14, 13, -1, 12,\r
+ 13, -1, 5, 3, 15, 6, 7, -1, 5, 3,\r
+ 15, 7, -1, 5, 6, 3, 7, -1, 11, -1,\r
+ 14, 11, -1, 16, -1, -1, 17, -1, 16, 17,\r
+ -1, 3, 8, 4, -1\r
+};\r
+\r
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */\r
+static const yytype_uint8 yyrline[] =\r
+{\r
+ 0, 65, 65, 69, 70, 71, 75, 79, 84, 85,\r
+ 89, 90, 94, 95, 99\r
+};\r
+#endif\r
+\r
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE\r
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.\r
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */\r
+static const char *const yytname[] =\r
+{\r
+ "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "'<'", "'/'",\r
+ "'>'", "'='", "$accept", "parse_result", "resource", "start_tag",\r
+ "end_tag", "xml_list", "opt_val_list", "val_list", "val", 0\r
+};\r
+#endif\r
+\r
+# ifdef YYPRINT\r
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to\r
+ token YYLEX-NUM. */\r
+static const yytype_uint16 yytoknum[] =\r
+{\r
+ 0, 256, 257, 258, 259, 60, 47, 62, 61\r
+};\r
+# endif\r
+\r
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */\r
+static const yytype_uint8 yyr1[] =\r
+{\r
+ 0, 9, 10, 11, 11, 11, 12, 13, 14, 14,\r
+ 15, 15, 16, 16, 17\r
+};\r
+\r
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */\r
+static const yytype_uint8 yyr2[] =\r
+{\r
+ 0, 2, 1, 3, 2, 5, 4, 4, 1, 2,\r
+ 1, 0, 1, 2, 3\r
+};\r
+\r
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state\r
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero\r
+ means the default is an error. */\r
+static const yytype_uint8 yydefact[] =\r
+{\r
+ 0, 0, 0, 2, 0, 11, 1, 0, 8, 4,\r
+ 0, 0, 0, 10, 12, 0, 9, 3, 0, 0,\r
+ 6, 13, 0, 14, 5, 7\r
+};\r
+\r
+/* YYDEFGOTO[NTERM-NUM]. */\r
+static const yytype_int8 yydefgoto[] =\r
+{\r
+ -1, 2, 3, 4, 9, 10, 12, 13, 14\r
+};\r
+\r
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing\r
+ STATE-NUM. */\r
+#define YYPACT_NINF -5\r
+static const yytype_int8 yypact[] =\r
+{\r
+ -3, 0, 5, -5, 4, 7, -5, -2, -5, -5,\r
+ 4, 3, 1, 7, -5, 9, -5, -5, 10, 6,\r
+ -5, -5, 8, -5, -5, -5\r
+};\r
+\r
+/* YYPGOTO[NTERM-NUM]. */\r
+static const yytype_int8 yypgoto[] =\r
+{\r
+ -5, -5, -4, -5, 11, -5, -5, -5, 12\r
+};\r
+\r
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If\r
+ positive, shift that token. If negative, reduce the rule which\r
+ number is the opposite. If zero, do what YYDEFACT says.\r
+ If YYTABLE_NINF, syntax error. */\r
+#define YYTABLE_NINF -1\r
+static const yytype_uint8 yytable[] =\r
+{\r
+ 8, 5, 1, 5, 15, 6, 16, 19, 20, 7,\r
+ 11, 18, 22, 24, 23, 25, 0, 0, 0, 0,\r
+ 0, 17, 0, 0, 0, 21\r
+};\r
+\r
+static const yytype_int8 yycheck[] =\r
+{\r
+ 4, 3, 5, 3, 6, 0, 10, 6, 7, 5,\r
+ 3, 8, 3, 7, 4, 7, -1, -1, -1, -1,\r
+ -1, 10, -1, -1, -1, 13\r
+};\r
+\r
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing\r
+ symbol of state STATE-NUM. */\r
+static const yytype_uint8 yystos[] =\r
+{\r
+ 0, 5, 10, 11, 12, 3, 0, 5, 11, 13,\r
+ 14, 3, 15, 16, 17, 6, 11, 13, 8, 6,\r
+ 7, 17, 3, 4, 7, 7\r
+};\r
+\r
+#define yyerrok (yyerrstatus = 0)\r
+#define yyclearin (yychar = YYEMPTY)\r
+#define YYEMPTY (-2)\r
+#define YYEOF 0\r
+\r
+#define YYACCEPT goto yyacceptlab\r
+#define YYABORT goto yyabortlab\r
+#define YYERROR goto yyerrorlab\r
+\r
+\r
+/* Like YYERROR except do call yyerror. This remains here temporarily\r
+ to ease the transition to the new meaning of YYERROR, for GCC.\r
+ Once GCC version 2 has supplanted version 1, this can go. */\r
+\r
+#define YYFAIL goto yyerrlab\r
+\r
+#define YYRECOVERING() (!!yyerrstatus)\r
+\r
+#define YYBACKUP(Token, Value) \\r
+do \\r
+ if (yychar == YYEMPTY && yylen == 1) \\r
+ { \\r
+ yychar = (Token); \\r
+ yylval = (Value); \\r
+ yytoken = YYTRANSLATE (yychar); \\r
+ YYPOPSTACK (1); \\r
+ goto yybackup; \\r
+ } \\r
+ else \\r
+ { \\r
+ yyerror (YY_("syntax error: cannot back up")); \\r
+ YYERROR; \\r
+ } \\r
+while (YYID (0))\r
+\r
+\r
+#define YYTERROR 1\r
+#define YYERRCODE 256\r
+\r
+\r
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].\r
+ If N is 0, then set CURRENT to the empty location which ends\r
+ the previous symbol: RHS[0] (always defined). */\r
+\r
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])\r
+#ifndef YYLLOC_DEFAULT\r
+# define YYLLOC_DEFAULT(Current, Rhs, N) \\r
+ do \\r
+ if (YYID (N)) \\r
+ { \\r
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \\r
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \\r
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \\r
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \\r
+ } \\r
+ else \\r
+ { \\r
+ (Current).first_line = (Current).last_line = \\r
+ YYRHSLOC (Rhs, 0).last_line; \\r
+ (Current).first_column = (Current).last_column = \\r
+ YYRHSLOC (Rhs, 0).last_column; \\r
+ } \\r
+ while (YYID (0))\r
+#endif\r
+\r
+\r
+/* YY_LOCATION_PRINT -- Print the location on the stream.\r
+ This macro was not mandated originally: define only if we know\r
+ we won't break user code: when these are the locations we know. */\r
+\r
+#ifndef YY_LOCATION_PRINT\r
+# if YYLTYPE_IS_TRIVIAL\r
+# define YY_LOCATION_PRINT(File, Loc) \\r
+ fprintf (File, "%d.%d-%d.%d", \\r
+ (Loc).first_line, (Loc).first_column, \\r
+ (Loc).last_line, (Loc).last_column)\r
+# else\r
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)\r
+# endif\r
+#endif\r
+\r
+\r
+/* YYLEX -- calling `yylex' with the right arguments. */\r
+\r
+#ifdef YYLEX_PARAM\r
+# define YYLEX yylex (YYLEX_PARAM)\r
+#else\r
+# define YYLEX yylex ()\r
+#endif\r
+\r
+/* Enable debugging if requested. */\r
+#if YYDEBUG\r
+\r
+# ifndef YYFPRINTF\r
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */\r
+# define YYFPRINTF fprintf\r
+# endif\r
+\r
+# define YYDPRINTF(Args) \\r
+do { \\r
+ if (yydebug) \\r
+ YYFPRINTF Args; \\r
+} while (YYID (0))\r
+\r
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \\r
+do { \\r
+ if (yydebug) \\r
+ { \\r
+ YYFPRINTF (stderr, "%s ", Title); \\r
+ yy_symbol_print (stderr, \\r
+ Type, Value); \\r
+ YYFPRINTF (stderr, "\n"); \\r
+ } \\r
+} while (YYID (0))\r
+\r
+\r
+/*--------------------------------.\r
+| Print this symbol on YYOUTPUT. |\r
+`--------------------------------*/\r
+\r
+/*ARGSUSED*/\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static void\r
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)\r
+#else\r
+static void\r
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)\r
+ FILE *yyoutput;\r
+ int yytype;\r
+ YYSTYPE const * const yyvaluep;\r
+#endif\r
+{\r
+ if (!yyvaluep)\r
+ return;\r
+# ifdef YYPRINT\r
+ if (yytype < YYNTOKENS)\r
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);\r
+# else\r
+ YYUSE (yyoutput);\r
+# endif\r
+ switch (yytype)\r
+ {\r
+ default:\r
+ break;\r
+ }\r
+}\r
+\r
+\r
+/*--------------------------------.\r
+| Print this symbol on YYOUTPUT. |\r
+`--------------------------------*/\r
+\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static void\r
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)\r
+#else\r
+static void\r
+yy_symbol_print (yyoutput, yytype, yyvaluep)\r
+ FILE *yyoutput;\r
+ int yytype;\r
+ YYSTYPE const * const yyvaluep;\r
+#endif\r
+{\r
+ if (yytype < YYNTOKENS)\r
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);\r
+ else\r
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);\r
+\r
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);\r
+ YYFPRINTF (yyoutput, ")");\r
+}\r
+\r
+/*------------------------------------------------------------------.\r
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |\r
+| TOP (included). |\r
+`------------------------------------------------------------------*/\r
+\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static void\r
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)\r
+#else\r
+static void\r
+yy_stack_print (bottom, top)\r
+ yytype_int16 *bottom;\r
+ yytype_int16 *top;\r
+#endif\r
+{\r
+ YYFPRINTF (stderr, "Stack now");\r
+ for (; bottom <= top; ++bottom)\r
+ YYFPRINTF (stderr, " %d", *bottom);\r
+ YYFPRINTF (stderr, "\n");\r
+}\r
+\r
+# define YY_STACK_PRINT(Bottom, Top) \\r
+do { \\r
+ if (yydebug) \\r
+ yy_stack_print ((Bottom), (Top)); \\r
+} while (YYID (0))\r
+\r
+\r
+/*------------------------------------------------.\r
+| Report that the YYRULE is going to be reduced. |\r
+`------------------------------------------------*/\r
+\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static void\r
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)\r
+#else\r
+static void\r
+yy_reduce_print (yyvsp, yyrule)\r
+ YYSTYPE *yyvsp;\r
+ int yyrule;\r
+#endif\r
+{\r
+ int yynrhs = yyr2[yyrule];\r
+ int yyi;\r
+ unsigned long int yylno = yyrline[yyrule];\r
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",\r
+ yyrule - 1, yylno);\r
+ /* The symbols being reduced. */\r
+ for (yyi = 0; yyi < yynrhs; yyi++)\r
+ {\r
+ fprintf (stderr, " $%d = ", yyi + 1);\r
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],\r
+ &(yyvsp[(yyi + 1) - (yynrhs)])\r
+ );\r
+ fprintf (stderr, "\n");\r
+ }\r
+}\r
+\r
+# define YY_REDUCE_PRINT(Rule) \\r
+do { \\r
+ if (yydebug) \\r
+ yy_reduce_print (yyvsp, Rule); \\r
+} while (YYID (0))\r
+\r
+/* Nonzero means print parse trace. It is left uninitialized so that\r
+ multiple parsers can coexist. */\r
+int yydebug;\r
+#else /* !YYDEBUG */\r
+# define YYDPRINTF(Args)\r
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)\r
+# define YY_STACK_PRINT(Bottom, Top)\r
+# define YY_REDUCE_PRINT(Rule)\r
+#endif /* !YYDEBUG */\r
+\r
+\r
+/* YYINITDEPTH -- initial size of the parser's stacks. */\r
+#ifndef YYINITDEPTH\r
+# define YYINITDEPTH 200\r
+#endif\r
+\r
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only\r
+ if the built-in stack extension method is used).\r
+\r
+ Do not make this value too large; the results are undefined if\r
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)\r
+ evaluated with infinite-precision integer arithmetic. */\r
+\r
+#ifndef YYMAXDEPTH\r
+# define YYMAXDEPTH 10000\r
+#endif\r
+\r
+\f\r
+\r
+#if YYERROR_VERBOSE\r
+\r
+# ifndef yystrlen\r
+# if defined __GLIBC__ && defined _STRING_H\r
+# define yystrlen strlen\r
+# else\r
+/* Return the length of YYSTR. */\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static YYSIZE_T\r
+yystrlen (const char *yystr)\r
+#else\r
+static YYSIZE_T\r
+yystrlen (yystr)\r
+ const char *yystr;\r
+#endif\r
+{\r
+ YYSIZE_T yylen;\r
+ for (yylen = 0; yystr[yylen]; yylen++)\r
+ continue;\r
+ return yylen;\r
+}\r
+# endif\r
+# endif\r
+\r
+# ifndef yystpcpy\r
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE\r
+# define yystpcpy stpcpy\r
+# else\r
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in\r
+ YYDEST. */\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static char *\r
+yystpcpy (char *yydest, const char *yysrc)\r
+#else\r
+static char *\r
+yystpcpy (yydest, yysrc)\r
+ char *yydest;\r
+ const char *yysrc;\r
+#endif\r
+{\r
+ char *yyd = yydest;\r
+ const char *yys = yysrc;\r
+\r
+ while ((*yyd++ = *yys++) != '\0')\r
+ continue;\r
+\r
+ return yyd - 1;\r
+}\r
+# endif\r
+# endif\r
+\r
+# ifndef yytnamerr\r
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary\r
+ quotes and backslashes, so that it's suitable for yyerror. The\r
+ heuristic is that double-quoting is unnecessary unless the string\r
+ contains an apostrophe, a comma, or backslash (other than\r
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is\r
+ null, do not copy; instead, return the length of what the result\r
+ would have been. */\r
+static YYSIZE_T\r
+yytnamerr (char *yyres, const char *yystr)\r
+{\r
+ if (*yystr == '"')\r
+ {\r
+ YYSIZE_T yyn = 0;\r
+ char const *yyp = yystr;\r
+\r
+ for (;;)\r
+ switch (*++yyp)\r
+ {\r
+ case '\'':\r
+ case ',':\r
+ goto do_not_strip_quotes;\r
+\r
+ case '\\':\r
+ if (*++yyp != '\\')\r
+ goto do_not_strip_quotes;\r
+ /* Fall through. */\r
+ default:\r
+ if (yyres)\r
+ yyres[yyn] = *yyp;\r
+ yyn++;\r
+ break;\r
+\r
+ case '"':\r
+ if (yyres)\r
+ yyres[yyn] = '\0';\r
+ return yyn;\r
+ }\r
+ do_not_strip_quotes: ;\r
+ }\r
+\r
+ if (! yyres)\r
+ return yystrlen (yystr);\r
+\r
+ return yystpcpy (yyres, yystr) - yyres;\r
+}\r
+# endif\r
+\r
+/* Copy into YYRESULT an error message about the unexpected token\r
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,\r
+ including the terminating null byte. If YYRESULT is null, do not\r
+ copy anything; just return the number of bytes that would be\r
+ copied. As a special case, return 0 if an ordinary "syntax error"\r
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during\r
+ size calculation. */\r
+static YYSIZE_T\r
+yysyntax_error (char *yyresult, int yystate, int yychar)\r
+{\r
+ int yyn = yypact[yystate];\r
+\r
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))\r
+ return 0;\r
+ else\r
+ {\r
+ int yytype = YYTRANSLATE (yychar);\r
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);\r
+ YYSIZE_T yysize = yysize0;\r
+ YYSIZE_T yysize1;\r
+ int yysize_overflow = 0;\r
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };\r
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];\r
+ int yyx;\r
+\r
+# if 0\r
+ /* This is so xgettext sees the translatable formats that are\r
+ constructed on the fly. */\r
+ YY_("syntax error, unexpected %s");\r
+ YY_("syntax error, unexpected %s, expecting %s");\r
+ YY_("syntax error, unexpected %s, expecting %s or %s");\r
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");\r
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");\r
+# endif\r
+ char *yyfmt;\r
+ char const *yyf;\r
+ static char const yyunexpected[] = "syntax error, unexpected %s";\r
+ static char const yyexpecting[] = ", expecting %s";\r
+ static char const yyor[] = " or %s";\r
+ char yyformat[sizeof yyunexpected\r
+ + sizeof yyexpecting - 1\r
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)\r
+ * (sizeof yyor - 1))];\r
+ char const *yyprefix = yyexpecting;\r
+\r
+ /* Start YYX at -YYN if negative to avoid negative indexes in\r
+ YYCHECK. */\r
+ int yyxbegin = yyn < 0 ? -yyn : 0;\r
+\r
+ /* Stay within bounds of both yycheck and yytname. */\r
+ int yychecklim = YYLAST - yyn + 1;\r
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;\r
+ int yycount = 1;\r
+\r
+ yyarg[0] = yytname[yytype];\r
+ yyfmt = yystpcpy (yyformat, yyunexpected);\r
+\r
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)\r
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)\r
+ {\r
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)\r
+ {\r
+ yycount = 1;\r
+ yysize = yysize0;\r
+ yyformat[sizeof yyunexpected - 1] = '\0';\r
+ break;\r
+ }\r
+ yyarg[yycount++] = yytname[yyx];\r
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);\r
+ yysize_overflow |= (yysize1 < yysize);\r
+ yysize = yysize1;\r
+ yyfmt = yystpcpy (yyfmt, yyprefix);\r
+ yyprefix = yyor;\r
+ }\r
+\r
+ yyf = YY_(yyformat);\r
+ yysize1 = yysize + yystrlen (yyf);\r
+ yysize_overflow |= (yysize1 < yysize);\r
+ yysize = yysize1;\r
+\r
+ if (yysize_overflow)\r
+ return YYSIZE_MAXIMUM;\r
+\r
+ if (yyresult)\r
+ {\r
+ /* Avoid sprintf, as that infringes on the user's name space.\r
+ Don't have undefined behavior even if the translation\r
+ produced a string with the wrong number of "%s"s. */\r
+ char *yyp = yyresult;\r
+ int yyi = 0;\r
+ while ((*yyp = *yyf) != '\0')\r
+ {\r
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)\r
+ {\r
+ yyp += yytnamerr (yyp, yyarg[yyi++]);\r
+ yyf += 2;\r
+ }\r
+ else\r
+ {\r
+ yyp++;\r
+ yyf++;\r
+ }\r
+ }\r
+ }\r
+ return yysize;\r
+ }\r
+}\r
+#endif /* YYERROR_VERBOSE */\r
+\f\r
+\r
+/*-----------------------------------------------.\r
+| Release the memory associated to this symbol. |\r
+`-----------------------------------------------*/\r
+\r
+/*ARGSUSED*/\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+static void\r
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)\r
+#else\r
+static void\r
+yydestruct (yymsg, yytype, yyvaluep)\r
+ const char *yymsg;\r
+ int yytype;\r
+ YYSTYPE *yyvaluep;\r
+#endif\r
+{\r
+ YYUSE (yyvaluep);\r
+\r
+ if (!yymsg)\r
+ yymsg = "Deleting";\r
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);\r
+\r
+ switch (yytype)\r
+ {\r
+\r
+ default:\r
+ break;\r
+ }\r
+}\r
+\f\r
+\r
+/* Prevent warnings from -Wmissing-prototypes. */\r
+\r
+#ifdef YYPARSE_PARAM\r
+#if defined __STDC__ || defined __cplusplus\r
+int yyparse (void *YYPARSE_PARAM);\r
+#else\r
+int yyparse ();\r
+#endif\r
+#else /* ! YYPARSE_PARAM */\r
+#if defined __STDC__ || defined __cplusplus\r
+int yyparse (void);\r
+#else\r
+int yyparse ();\r
+#endif\r
+#endif /* ! YYPARSE_PARAM */\r
+\r
+\r
+\r
+/* The look-ahead symbol. */\r
+int yychar;\r
+\r
+/* The semantic value of the look-ahead symbol. */\r
+YYSTYPE yylval;\r
+\r
+/* Number of syntax errors so far. */\r
+int yynerrs;\r
+\r
+\r
+\r
+/*----------.\r
+| yyparse. |\r
+`----------*/\r
+\r
+#ifdef YYPARSE_PARAM\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+int\r
+yyparse (void *YYPARSE_PARAM)\r
+#else\r
+int\r
+yyparse (YYPARSE_PARAM)\r
+ void *YYPARSE_PARAM;\r
+#endif\r
+#else /* ! YYPARSE_PARAM */\r
+#if (defined __STDC__ || defined __C99__FUNC__ \\r
+ || defined __cplusplus || defined _MSC_VER)\r
+int\r
+yyparse (void)\r
+#else\r
+int\r
+yyparse ()\r
+\r
+#endif\r
+#endif\r
+{\r
+ \r
+ int yystate;\r
+ int yyn;\r
+ int yyresult;\r
+ /* Number of tokens to shift before error messages enabled. */\r
+ int yyerrstatus;\r
+ /* Look-ahead token as an internal (translated) token number. */\r
+ int yytoken = 0;\r
+#if YYERROR_VERBOSE\r
+ /* Buffer for error messages, and its allocated size. */\r
+ char yymsgbuf[128];\r
+ char *yymsg = yymsgbuf;\r
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;\r
+#endif\r
+\r
+ /* Three stacks and their tools:\r
+ `yyss': related to states,\r
+ `yyvs': related to semantic values,\r
+ `yyls': related to locations.\r
+\r
+ Refer to the stacks thru separate pointers, to allow yyoverflow\r
+ to reallocate them elsewhere. */\r
+\r
+ /* The state stack. */\r
+ yytype_int16 yyssa[YYINITDEPTH];\r
+ yytype_int16 *yyss = yyssa;\r
+ yytype_int16 *yyssp;\r
+\r
+ /* The semantic value stack. */\r
+ YYSTYPE yyvsa[YYINITDEPTH];\r
+ YYSTYPE *yyvs = yyvsa;\r
+ YYSTYPE *yyvsp;\r
+\r
+\r
+\r
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))\r
+\r
+ YYSIZE_T yystacksize = YYINITDEPTH;\r
+\r
+ /* The variables used to return semantic value and location from the\r
+ action routines. */\r
+ YYSTYPE yyval;\r
+\r
+\r
+ /* The number of symbols on the RHS of the reduced rule.\r
+ Keep to zero when no symbol should be popped. */\r
+ int yylen = 0;\r
+\r
+ YYDPRINTF ((stderr, "Starting parse\n"));\r
+\r
+ yystate = 0;\r
+ yyerrstatus = 0;\r
+ yynerrs = 0;\r
+ yychar = YYEMPTY; /* Cause a token to be read. */\r
+\r
+ /* Initialize stack pointers.\r
+ Waste one element of value and location stack\r
+ so that they stay on the same level as the state stack.\r
+ The wasted elements are never initialized. */\r
+\r
+ yyssp = yyss;\r
+ yyvsp = yyvs;\r
+\r
+ goto yysetstate;\r
+\r
+/*------------------------------------------------------------.\r
+| yynewstate -- Push a new state, which is found in yystate. |\r
+`------------------------------------------------------------*/\r
+ yynewstate:\r
+ /* In all cases, when you get here, the value and location stacks\r
+ have just been pushed. So pushing a state here evens the stacks. */\r
+ yyssp++;\r
+\r
+ yysetstate:\r
+ *yyssp = yystate;\r
+\r
+ if (yyss + yystacksize - 1 <= yyssp)\r
+ {\r
+ /* Get the current used size of the three stacks, in elements. */\r
+ YYSIZE_T yysize = yyssp - yyss + 1;\r
+\r
+#ifdef yyoverflow\r
+ {\r
+ /* Give user a chance to reallocate the stack. Use copies of\r
+ these so that the &'s don't force the real ones into\r
+ memory. */\r
+ YYSTYPE *yyvs1 = yyvs;\r
+ yytype_int16 *yyss1 = yyss;\r
+\r
+\r
+ /* Each stack pointer address is followed by the size of the\r
+ data in use in that stack, in bytes. This used to be a\r
+ conditional around just the two extra args, but that might\r
+ be undefined if yyoverflow is a macro. */\r
+ yyoverflow (YY_("memory exhausted"),\r
+ &yyss1, yysize * sizeof (*yyssp),\r
+ &yyvs1, yysize * sizeof (*yyvsp),\r
+\r
+ &yystacksize);\r
+\r
+ yyss = yyss1;\r
+ yyvs = yyvs1;\r
+ }\r
+#else /* no yyoverflow */\r
+# ifndef YYSTACK_RELOCATE\r
+ goto yyexhaustedlab;\r
+# else\r
+ /* Extend the stack our own way. */\r
+ if (YYMAXDEPTH <= yystacksize)\r
+ goto yyexhaustedlab;\r
+ yystacksize *= 2;\r
+ if (YYMAXDEPTH < yystacksize)\r
+ yystacksize = YYMAXDEPTH;\r
+\r
+ {\r
+ yytype_int16 *yyss1 = yyss;\r
+ union yyalloc *yyptr =\r
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));\r
+ if (! yyptr)\r
+ goto yyexhaustedlab;\r
+ YYSTACK_RELOCATE (yyss);\r
+ YYSTACK_RELOCATE (yyvs);\r
+\r
+# undef YYSTACK_RELOCATE\r
+ if (yyss1 != yyssa)\r
+ YYSTACK_FREE (yyss1);\r
+ }\r
+# endif\r
+#endif /* no yyoverflow */\r
+\r
+ yyssp = yyss + yysize - 1;\r
+ yyvsp = yyvs + yysize - 1;\r
+\r
+\r
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",\r
+ (unsigned long int) yystacksize));\r
+\r
+ if (yyss + yystacksize - 1 <= yyssp)\r
+ YYABORT;\r
+ }\r
+\r
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));\r
+\r
+ goto yybackup;\r
+\r
+/*-----------.\r
+| yybackup. |\r
+`-----------*/\r
+yybackup:\r
+\r
+ /* Do appropriate processing given the current state. Read a\r
+ look-ahead token if we need one and don't already have one. */\r
+\r
+ /* First try to decide what to do without reference to look-ahead token. */\r
+ yyn = yypact[yystate];\r
+ if (yyn == YYPACT_NINF)\r
+ goto yydefault;\r
+\r
+ /* Not known => get a look-ahead token if don't already have one. */\r
+\r
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */\r
+ if (yychar == YYEMPTY)\r
+ {\r
+ YYDPRINTF ((stderr, "Reading a token: "));\r
+ yychar = YYLEX;\r
+ }\r
+\r
+ if (yychar <= YYEOF)\r
+ {\r
+ yychar = yytoken = YYEOF;\r
+ YYDPRINTF ((stderr, "Now at end of input.\n"));\r
+ }\r
+ else\r
+ {\r
+ yytoken = YYTRANSLATE (yychar);\r
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);\r
+ }\r
+\r
+ /* If the proper action on seeing token YYTOKEN is to reduce or to\r
+ detect an error, take that action. */\r
+ yyn += yytoken;\r
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)\r
+ goto yydefault;\r
+ yyn = yytable[yyn];\r
+ if (yyn <= 0)\r
+ {\r
+ if (yyn == 0 || yyn == YYTABLE_NINF)\r
+ goto yyerrlab;\r
+ yyn = -yyn;\r
+ goto yyreduce;\r
+ }\r
+\r
+ if (yyn == YYFINAL)\r
+ YYACCEPT;\r
+\r
+ /* Count tokens shifted since error; after three, turn off error\r
+ status. */\r
+ if (yyerrstatus)\r
+ yyerrstatus--;\r
+\r
+ /* Shift the look-ahead token. */\r
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);\r
+\r
+ /* Discard the shifted token unless it is eof. */\r
+ if (yychar != YYEOF)\r
+ yychar = YYEMPTY;\r
+\r
+ yystate = yyn;\r
+ *++yyvsp = yylval;\r
+\r
+ goto yynewstate;\r
+\r
+\r
+/*-----------------------------------------------------------.\r
+| yydefault -- do the default action for the current state. |\r
+`-----------------------------------------------------------*/\r
+yydefault:\r
+ yyn = yydefact[yystate];\r
+ if (yyn == 0)\r
+ goto yyerrlab;\r
+ goto yyreduce;\r
+\r
+\r
+/*-----------------------------.\r
+| yyreduce -- Do a reduction. |\r
+`-----------------------------*/\r
+yyreduce:\r
+ /* yyn is the number of a rule to reduce with. */\r
+ yylen = yyr2[yyn];\r
+\r
+ /* If YYLEN is nonzero, implement the default value of the action:\r
+ `$$ = $1'.\r
+\r
+ Otherwise, the following line sets YYVAL to garbage.\r
+ This behavior is undocumented and Bison\r
+ users should not rely upon it. Assigning to YYVAL\r
+ unconditionally makes the parser a bit smaller, and it avoids a\r
+ GCC warning that YYVAL may be used uninitialized. */\r
+ yyval = yyvsp[1-yylen];\r
+\r
+\r
+ YY_REDUCE_PRINT (yyn);\r
+ switch (yyn)\r
+ {\r
+ case 2:\r
+#line 65 "xml.y"\r
+ {xml_result = (yyvsp[(1) - (1)].x_t);;}\r
+ break;\r
+\r
+ case 3:\r
+#line 69 "xml.y"\r
+ {(yyval.x_t) = new xml_t((yyvsp[(1) - (3)].tg_t),(yyvsp[(2) - (3)].xlist_t),(yyvsp[(3) - (3)].strval));;}\r
+ break;\r
+\r
+ case 4:\r
+#line 70 "xml.y"\r
+ {(yyval.x_t)=new xml_t((yyvsp[(1) - (2)].tg_t),(yyvsp[(2) - (2)].strval));;}\r
+ break;\r
+\r
+ case 5:\r
+#line 71 "xml.y"\r
+ {(yyval.x_t)=new xml_t((yyvsp[(2) - (5)].strval),(yyvsp[(3) - (5)].nvpl));;}\r
+ break;\r
+\r
+ case 6:\r
+#line 75 "xml.y"\r
+ {(yyval.tg_t) = new tag_t((yyvsp[(2) - (4)].strval), (yyvsp[(3) - (4)].nvpl));;}\r
+ break;\r
+\r
+ case 7:\r
+#line 79 "xml.y"\r
+ {(yyval.strval)=(yyvsp[(3) - (4)].strval);;}\r
+ break;\r
+\r
+ case 8:\r
+#line 84 "xml.y"\r
+ {(yyval.xlist_t)=new xml_list_t((yyvsp[(1) - (1)].x_t));;}\r
+ break;\r
+\r
+ case 9:\r
+#line 85 "xml.y"\r
+ {(yyval.xlist_t)=(yyvsp[(1) - (2)].xlist_t)->append((yyvsp[(2) - (2)].x_t));;}\r
+ break;\r
+\r
+ case 10:\r
+#line 89 "xml.y"\r
+ {(yyval.nvpl)=(yyvsp[(1) - (1)].nvpl);;}\r
+ break;\r
+\r
+ case 11:\r
+#line 90 "xml.y"\r
+ {(yyval.nvpl)=new name_val_list_t();;}\r
+ break;\r
+\r
+ case 12:\r
+#line 94 "xml.y"\r
+ {(yyval.nvpl) = new name_val_list_t((yyvsp[(1) - (1)].nvpt));;}\r
+ break;\r
+\r
+ case 13:\r
+#line 95 "xml.y"\r
+ {(yyval.nvpl) = (yyvsp[(1) - (2)].nvpl)->append((yyvsp[(2) - (2)].nvpt));;}\r
+ break;\r
+\r
+ case 14:\r
+#line 99 "xml.y"\r
+ {(yyval.nvpt) = new name_val_pair_t((yyvsp[(1) - (3)].strval),(yyvsp[(3) - (3)].strval));;}\r
+ break;\r
+\r
+\r
+/* Line 1267 of yacc.c. */\r
+#line 1428 "xml.tab.cc"\r
+ default: break;\r
+ }\r
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);\r
+\r
+ YYPOPSTACK (yylen);\r
+ yylen = 0;\r
+ YY_STACK_PRINT (yyss, yyssp);\r
+\r
+ *++yyvsp = yyval;\r
+\r
+\r
+ /* Now `shift' the result of the reduction. Determine what state\r
+ that goes to, based on the state we popped back to and the rule\r
+ number reduced by. */\r
+\r
+ yyn = yyr1[yyn];\r
+\r
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;\r
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)\r
+ yystate = yytable[yystate];\r
+ else\r
+ yystate = yydefgoto[yyn - YYNTOKENS];\r
+\r
+ goto yynewstate;\r
+\r
+\r
+/*------------------------------------.\r
+| yyerrlab -- here on detecting error |\r
+`------------------------------------*/\r
+yyerrlab:\r
+ /* If not already recovering from an error, report this error. */\r
+ if (!yyerrstatus)\r
+ {\r
+ ++yynerrs;\r
+#if ! YYERROR_VERBOSE\r
+ yyerror (YY_("syntax error"));\r
+#else\r
+ {\r
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);\r
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)\r
+ {\r
+ YYSIZE_T yyalloc = 2 * yysize;\r
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))\r
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;\r
+ if (yymsg != yymsgbuf)\r
+ YYSTACK_FREE (yymsg);\r
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);\r
+ if (yymsg)\r
+ yymsg_alloc = yyalloc;\r
+ else\r
+ {\r
+ yymsg = yymsgbuf;\r
+ yymsg_alloc = sizeof yymsgbuf;\r
+ }\r
+ }\r
+\r
+ if (0 < yysize && yysize <= yymsg_alloc)\r
+ {\r
+ (void) yysyntax_error (yymsg, yystate, yychar);\r
+ yyerror (yymsg);\r
+ }\r
+ else\r
+ {\r
+ yyerror (YY_("syntax error"));\r
+ if (yysize != 0)\r
+ goto yyexhaustedlab;\r
+ }\r
+ }\r
+#endif\r
+ }\r
+\r
+\r
+\r
+ if (yyerrstatus == 3)\r
+ {\r
+ /* If just tried and failed to reuse look-ahead token after an\r
+ error, discard it. */\r
+\r
+ if (yychar <= YYEOF)\r
+ {\r
+ /* Return failure if at end of input. */\r
+ if (yychar == YYEOF)\r
+ YYABORT;\r
+ }\r
+ else\r
+ {\r
+ yydestruct ("Error: discarding",\r
+ yytoken, &yylval);\r
+ yychar = YYEMPTY;\r
+ }\r
+ }\r
+\r
+ /* Else will try to reuse look-ahead token after shifting the error\r
+ token. */\r
+ goto yyerrlab1;\r
+\r
+\r
+/*---------------------------------------------------.\r
+| yyerrorlab -- error raised explicitly by YYERROR. |\r
+`---------------------------------------------------*/\r
+yyerrorlab:\r
+\r
+ /* Pacify compilers like GCC when the user code never invokes\r
+ YYERROR and the label yyerrorlab therefore never appears in user\r
+ code. */\r
+ if (/*CONSTCOND*/ 0)\r
+ goto yyerrorlab;\r
+\r
+ /* Do not reclaim the symbols of the rule which action triggered\r
+ this YYERROR. */\r
+ YYPOPSTACK (yylen);\r
+ yylen = 0;\r
+ YY_STACK_PRINT (yyss, yyssp);\r
+ yystate = *yyssp;\r
+ goto yyerrlab1;\r
+\r
+\r
+/*-------------------------------------------------------------.\r
+| yyerrlab1 -- common code for both syntax error and YYERROR. |\r
+`-------------------------------------------------------------*/\r
+yyerrlab1:\r
+ yyerrstatus = 3; /* Each real token shifted decrements this. */\r
+\r
+ for (;;)\r
+ {\r
+ yyn = yypact[yystate];\r
+ if (yyn != YYPACT_NINF)\r
+ {\r
+ yyn += YYTERROR;\r
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)\r
+ {\r
+ yyn = yytable[yyn];\r
+ if (0 < yyn)\r
+ break;\r
+ }\r
+ }\r
+\r
+ /* Pop the current state because it cannot handle the error token. */\r
+ if (yyssp == yyss)\r
+ YYABORT;\r
+\r
+\r
+ yydestruct ("Error: popping",\r
+ yystos[yystate], yyvsp);\r
+ YYPOPSTACK (1);\r
+ yystate = *yyssp;\r
+ YY_STACK_PRINT (yyss, yyssp);\r
+ }\r
+\r
+ if (yyn == YYFINAL)\r
+ YYACCEPT;\r
+\r
+ *++yyvsp = yylval;\r
+\r
+\r
+ /* Shift the error token. */\r
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);\r
+\r
+ yystate = yyn;\r
+ goto yynewstate;\r
+\r
+\r
+/*-------------------------------------.\r
+| yyacceptlab -- YYACCEPT comes here. |\r
+`-------------------------------------*/\r
+yyacceptlab:\r
+ yyresult = 0;\r
+ goto yyreturn;\r
+\r
+/*-----------------------------------.\r
+| yyabortlab -- YYABORT comes here. |\r
+`-----------------------------------*/\r
+yyabortlab:\r
+ yyresult = 1;\r
+ goto yyreturn;\r
+\r
+#ifndef yyoverflow\r
+/*-------------------------------------------------.\r
+| yyexhaustedlab -- memory exhaustion comes here. |\r
+`-------------------------------------------------*/\r
+yyexhaustedlab:\r
+ yyerror (YY_("memory exhausted"));\r
+ yyresult = 2;\r
+ /* Fall through. */\r
+#endif\r
+\r
+yyreturn:\r
+ if (yychar != YYEOF && yychar != YYEMPTY)\r
+ yydestruct ("Cleanup: discarding lookahead",\r
+ yytoken, &yylval);\r
+ /* Do not reclaim the symbols of the rule which action triggered\r
+ this YYABORT or YYACCEPT. */\r
+ YYPOPSTACK (yylen);\r
+ YY_STACK_PRINT (yyss, yyssp);\r
+ while (yyssp != yyss)\r
+ {\r
+ yydestruct ("Cleanup: popping",\r
+ yystos[*yyssp], yyvsp);\r
+ YYPOPSTACK (1);\r
+ }\r
+#ifndef yyoverflow\r
+ if (yyss != yyssa)\r
+ YYSTACK_FREE (yyss);\r
+#endif\r
+#if YYERROR_VERBOSE\r
+ if (yymsg != yymsgbuf)\r
+ YYSTACK_FREE (yymsg);\r
+#endif\r
+ /* Make sure YYID is used. */\r
+ return YYID (yyresult);\r
+}\r
+\r
+\r
+#line 106 "xml.y"\r
+\r
+\r
+\r
+\r