#endif
/* Enabling verbose error messages. */
-#undef YYERROR_VERBOSE
-#define YYERROR_VERBOSE %%error-verbose
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE %%error-verbose
+#endif
/* If name_prefix is specify substitute the variables and functions
names. */
#define yydebug %%prefix##debug
#define yynerrs %%prefix##nerrs
+/* Copy the user declarations. */
+%%prologue
+
#ifndef YYSTYPE
typedef %%stype yystype;
# define YYSTYPE yystype
# define YYLTYPE %%ltype
#endif
-/* Copy the user declarations. */
-%%prologue
-
-#line %%line "%%skeleton"
-
-#include <stdio.h>
+/* Line %%skeleton-line of %%skeleton. */
+#line %%line "%%parser-file-name"
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#ifdef __cplusplus
+# define YYSTD(x) std::x
+#else
+# define YYSTD(x) x
+#endif
+
+#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
+# define YYSIZE_T YYSTD (size_t)
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
+# define YYSIZE_T YYSTD (size_t)
# else
-# if defined (__GNUC__) || defined (_AIX) || defined (__hpux)
+# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# endif
-# ifndef __GNUC__
-# ifdef _AIX
- # pragma alloca
-# endif
-# if defined (__sgi) || defined (__sparc__) || defined (__sparc) || defined (__sun)
-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
-# endif
-# endif
# endif
# endif
# endif
# ifdef __cplusplus
# include <cstdlib> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T std::size_t
-# define YYSTACK_ALLOC std::malloc
-# define YYSTACK_FREE std::free
# else
# ifdef __STDC__
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
# endif
+# define YYSTACK_ALLOC YYSTD (malloc)
+# define YYSTACK_FREE YYSTD (free)
# endif
/* A type that is properly aligned for any stack member. */
/* Tokens. */
%%tokendef
-#define YYFINAL %%final
-#define YYFLAG %%flag
-#define YYNTBASE %%ntbase
-#define YYLAST %%last
-
-#define YYNTOKENS %%ntokens
-#define YYNNTS %%nnts
-#define YYNRULES %%nrules
-#define YYNSTATES %%nstates
-#define YYMAXUTOK %%maxtok
-
-/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL %%final
+#define YYFLAG %%flag
+#define YYLAST %%last
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS %%ntokens
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS %%nnts
+/* YYNRULES -- Number of rules. */
+#define YYNRULES %%nrules
+/* YYNRULES -- Number of states. */
+#define YYNSTATES %%nstates
+#define YYMAXUTOK %%maxtok
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= %%maxtok ? yytranslate[x] : %%nsym)
-/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const char yytranslate[] =
{
%%translate
};
#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
static const short yyprhs[] =
{
%%prhs
};
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
%%rhs
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
+#if (YYDEBUG) || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
%%tname
%%defact
};
+/* YYPGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
%%defgoto
};
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
static const short yypact[] =
{
%%pact
};
+/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
%%pgoto
};
+/* 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. */
static const short yytable[] =
{
%%table
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
- yylval = (Value); \
+ yylval = (Value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
- yyerror ("syntax error: cannot back up"); \
+ yyerror ("syntax error: cannot back up"); \
YYERROR; \
} \
while (0)
# ifndef YYFPRINTF
# ifdef __cplusplus
# include <cstdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF std::fprintf
-# define YYSTDERR std::stderr
# else
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# define YYSTDERR stderr
# endif
+# define YYFPRINTF YYSTD (fprintf)
+# define YYSTDERR YYSTD (stderr)
# endif
# define YYDPRINTF(Args) \
\f
-#line %%line "%%skeleton"
-
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
int yyi;
YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
+ yyn - 1, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
+ for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
}
{
%%actions
}
-#line %%line "%%skeleton"
+
+/* Line %%skeleton-line of %%skeleton. */
+#line %%line "%%parser-file-name"
\f
yyvsp -= yylen;
yyssp -= yylen;
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTBASE];
+ yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;