+%%{section} %%{body} %%".c" %%{yacc}
/* -*- C -*- */
-/* A Bison parser, made from %%filename
- by GNU bison %%version. */
+/* A Bison parser, made from %%{filename}
+ by GNU bison %%{version}. */
/* Skeleton output parser for bison,
Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
#define YYBISON 1
/* Pure parsers. */
-#define YYPURE %%pure
+#define YYPURE %%{pure}
/* Using locations. */
-#define YYLSP_NEEDED %%locations-flag
+#define YYLSP_NEEDED %%{locations-flag}
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+ names. */
+#define yyparse %%{prefix}parse
+#define yylex %%{prefix}lex
+#define yyerror %%{prefix}error
+#define yylval %%{prefix}lval
+#define yychar %%{prefix}char
+#define yydebug %%{prefix}debug
+#define yynerrs %%{prefix}nerrs
+#if YYLSP_NEEDED
+# define yylloc %%{prefix}lloc
+#endif
+
+
+/* Copy the user declarations. */
+%%{prologue}
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG %%debug
+# define YYDEBUG %%{debug}
#endif
/* Enabling verbose error messages. */
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
-# define YYERROR_VERBOSE %%error-verbose
+# define YYERROR_VERBOSE %%{error-verbose}
#endif
-/* If name_prefix is specify substitute the variables and functions
- names. */
-#define yyparse %%prefix##parse
-#define yylex %%prefix##lex
-#define yyerror %%prefix##error
-#define yylval %%prefix##lval
-#define yychar %%prefix##char
-#define yydebug %%prefix##debug
-#define yynerrs %%prefix##nerrs
-
#ifndef YYSTYPE
-typedef %%stype yystype;
+typedef %%{stype} yystype;
# define YYSTYPE yystype
#endif
int last_line;
int last_column;
} yyltype;
-# define YYLTYPE %%ltype
+# define YYLTYPE %%{ltype}
#endif
-/* Copy the user declarations. */
-%%prologue
-
-/* Line %%skeleton-line of %%skeleton. */
-#line %%line "%%parser-file-name"
-
-#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. */
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
/* Tokens. */
-%%tokendef
+%%{tokendef}
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL %%final
-#define YYFLAG %%flag
-#define YYLAST %%last
+#define YYFINAL %%{final}
+#define YYFLAG %%{flag}
+#define YYLAST %%{last}
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS %%ntokens
+#define YYNTOKENS %%{ntokens}
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS %%nnts
+#define YYNNTS %%{nnts}
/* YYNRULES -- Number of rules. */
-#define YYNRULES %%nrules
+#define YYNRULES %%{nrules}
/* YYNRULES -- Number of states. */
-#define YYNSTATES %%nstates
-#define YYMAXUTOK %%maxtok
+#define YYNSTATES %%{nstates}
+#define YYMAXUTOK %%{maxtok}
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYTRANSLATE(x) ((unsigned)(x) <= %%maxtok ? yytranslate[x] : %%nsym)
+#define YYTRANSLATE(x) ((unsigned)(x) <= %%{maxtok} ? yytranslate[x] : %%{nsym})
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const char yytranslate[] =
{
- %%translate
+ %%{translate}
};
#if YYDEBUG
YYRHS. */
static const short yyprhs[] =
{
- %%prhs
+ %%{prhs}
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
- %%rhs
+ %%{rhs}
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
- %%rline
+ %%{rline}
};
#endif
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- %%tname
+ %%{tname}
};
#endif
/* YYTOKNUM[YYN] -- Index in YYTNAME corresponding to YYLEX. */
static const short yytoknum[] =
{
- %%toknum
+ %%{toknum}
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
- %%r1
+ %%{r1}
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[] =
{
- %%r2
+ %%{r2}
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
error. */
static const short yydefact[] =
{
- %%defact
+ %%{defact}
};
/* YYPGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
- %%defgoto
+ %%{defgoto}
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const short yypact[] =
{
- %%pact
+ %%{pact}
};
/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
- %%pgoto
+ %%{pgoto}
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
number is the opposite. If zero, do what YYDEFACT says. */
static const short yytable[] =
{
- %%table
+ %%{table}
};
static const short yycheck[] =
{
- %%check
+ %%{check}
};
# ifndef YYFPRINTF
# ifdef __cplusplus
-# include <cstdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF std::fprintf
-# define YYSTDERR std::stderr
+# include <cstdio> /* INFRINGES ON USER NAME SPACE */
# else
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# define YYSTDERR stderr
# endif
+# define YYFPRINTF YYSTD (fprintf)
# endif
# define YYDPRINTF(Args) \
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-# define YYINITDEPTH %%initdepth
+# define YYINITDEPTH %%{initdepth}
#endif
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
#endif
#ifndef YYMAXDEPTH
-# define YYMAXDEPTH %%maxdepth
+# define YYMAXDEPTH %%{maxdepth}
#endif
\f
rule. */
int yylen;
- YYDPRINTF ((YYSTDERR, "Starting parse\n"));
+ YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yylsp = yyls + yysize - 1;
#endif
- YYDPRINTF ((YYSTDERR, "Stack size increased to %lu\n",
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- YYDPRINTF ((YYSTDERR, "Entering state %d\n", yystate));
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
if (yychar == YYEMPTY)
{
- YYDPRINTF ((YYSTDERR, "Reading a token: "));
+ YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more. */
- YYDPRINTF ((YYSTDERR, "Now at end of input.\n"));
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
which are defined only if `YYDEBUG' is set. */
if (yydebug)
{
- YYFPRINTF (YYSTDERR, "Next token is %d (%s",
+ YYFPRINTF (stderr, "Next token is %d (%s",
yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise
meaning of a token, for further debugging info. */
# ifdef YYPRINT
- YYPRINT (YYSTDERR, yychar, yylval);
+ YYPRINT (stderr, yychar, yylval);
# endif
- YYFPRINTF (YYSTDERR, ")\n");
+ YYFPRINTF (stderr, ")\n");
}
#endif
}
YYACCEPT;
/* Shift the lookahead token. */
- YYDPRINTF ((YYSTDERR, "Shifting token %d (%s), ",
+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
yychar, yytname[yychar1]));
/* Discard the token being shifted unless it is eof. */
{
int yyi;
- YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
yyn - 1, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
- YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn)
{
-%%actions
+ %%{actions}
}
-/* Line %%skeleton-line of %%skeleton. */
-#line %%line "%%parser-file-name"
+/* Line %%{skeleton-line} of %%{skeleton}. */
+#line %%{line} "%%{parser-file-name}"
\f
yyvsp -= yylen;
yyssp -= yylen;
if (yydebug)
{
short *yyssp1 = yyss - 1;
- YYFPRINTF (YYSTDERR, "state stack now");
+ YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
- YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
- YYFPRINTF (YYSTDERR, "\n");
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
}
#endif
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
- YYDPRINTF ((YYSTDERR, "Discarding token %d (%s).\n",
+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
yychar, yytname[yychar1]));
yychar = YYEMPTY;
}
if (yydebug)
{
short *yyssp1 = yyss - 1;
- YYFPRINTF (YYSTDERR, "Error: state stack now");
+ YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
- YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
- YYFPRINTF (YYSTDERR, "\n");
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
}
#endif
if (yyn == YYFINAL)
YYACCEPT;
- YYDPRINTF ((YYSTDERR, "Shifting error token, "));
+ YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
#if YYLSP_NEEDED
return yyresult;
}
-%%epilogue
+%%{epilogue}