]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
doc: check the rpcalc.
[bison.git] / data / c.m4
index d09d1f1c3faa56f6751e10ac31c6f7795bd51957..78d8e9c0b7f82c896e6efd41a9ae84cf9ef44ecf 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -120,11 +120,15 @@ m4_popdef([$2])dnl
 m4_popdef([$1])dnl
 ])])
 
 m4_popdef([$1])dnl
 ])])
 
-# 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);
 ])dnl
 ])
 
 ])dnl
 ])
 
@@ -444,11 +448,7 @@ m4_define_default([b4_yydestruct_generate],
 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);
@@ -483,16 +483,12 @@ m4_define_default([b4_yy_symbol_print_generate],
 b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
 m4_ifset([b4_parse_param], [, b4_parse_param]))[
 {
 b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
 m4_ifset([b4_parse_param], [, b4_parse_param]))[
 {
+]b4_parse_param_use([yyoutput], [yylocationp])[
   if (!yyvaluep)
     return;
   if (!yyvaluep)
     return;
-]b4_locations_if([  YYUSE (yylocationp);
-])dnl
-b4_parse_param_use[]dnl
-[# ifdef YYPRINT
+# 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)
     {