* data/c.m4 (b4_parse_param_use): Also accept optional arguments
to "use".
Simplify callers.
* data/glr.c (yyuserAction): Simplify use of b4_parse_param_use.
(yy_reduce_print): Don't use b4_parse_param_use, as all the arguments
_are_ used.
* data/lalr1.cc (YY_SYMBOL_PRINT): Even when disabled, "use" the
symbol argument.
This neutralizes a warning in yypush_ when there are no symbols
with a semantic values.
(yy_destroy_): Remove useless "use" of yymsg.
-# b4_parse_param_use
-# ------------------
-# `YYUSE' all the parse-params.
+# b4_parse_param_use([VAL], [LOC])
+# --------------------------------
+# `YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
m4_define([b4_parse_param_use],
m4_define([b4_parse_param_use],
-[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
+[m4_ifval([$1], [ YYUSE([$1]);
+])dnl
+m4_ifval([$2], [b4_locations_if([ YYUSE ([$2]);
+])])dnl
+b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
- YYUSE (yyvaluep);
-]b4_locations_if([ YYUSE (yylocationp);
-])dnl
-b4_parse_param_use[]dnl
-[
+]b4_parse_param_use([yyvaluep], [yylocationp])[
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-]b4_locations_if([ YYUSE (yylocationp);
-])dnl
-b4_parse_param_use[]dnl
-[# ifdef YYPRINT
+]b4_parse_param_use([yyoutput], [yylocationp])[
+# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
# endif
switch (yytype)
{
# endif
switch (yytype)
{
yybool yynormal __attribute__ ((__unused__)) =
(yystackp->yysplitPoint == NULL);
int yylow;
yybool yynormal __attribute__ ((__unused__)) =
(yystackp->yysplitPoint == NULL);
int yylow;
-]b4_parse_param_use[]dnl
-[# undef yyerrok
+]b4_parse_param_use([yyvalp], [yylocp])[
+# undef yyerrok
# define yyerrok (yystackp->yyerrState = 0)
# undef YYACCEPT
# define YYACCEPT return yyaccept
# define yyerrok (yystackp->yyerrState = 0)
# undef YYACCEPT
# define YYACCEPT return yyaccept
int yynrhs = yyrhsLength (yyrule);]b4_locations_if([
int yylow = 1;])[
int yyi;
int yynrhs = yyrhsLength (yyrule);]b4_locations_if([
int yylow = 1;])[
int yyi;
-]b4_parse_param_use[]dnl
-[ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
(unsigned long int) yyk, yyrule - 1,
(unsigned long int) yyrline[yyrule]);
if (! yynormal)
(unsigned long int) yyk, yyrule - 1,
(unsigned long int) yyrline[yyrule]);
if (! yynormal)
#else /* !YYDEBUG */
# define YYCDEBUG if (false) std::cerr
#else /* !YYDEBUG */
# define YYCDEBUG if (false) std::cerr
-# define YY_SYMBOL_PRINT(Title, Symbol) static_cast<void>(0)
+# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
# define YY_STACK_PRINT() static_cast<void>(0)
# define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
# define YY_STACK_PRINT() static_cast<void>(0)
symbol_base_type<Exact>& yysym) const
{
int yytype = yysym.type_get ();
symbol_base_type<Exact>& yysym) const
{
int yytype = yysym.type_get ();
if (yymsg)
YY_SYMBOL_PRINT (yymsg, yysym);
if (yymsg)
YY_SYMBOL_PRINT (yymsg, yysym);