]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
* data/yacc.c (YY_LOCATION_PRINT): New.
[bison.git] / data / c.m4
index 1d81b54a3902c96dbfbf0315bb3aaa06debd54b6..04b2e76284dbac735f579447cc110707e809b7b5 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -396,23 +396,27 @@ m4_define([b4_yysymprint_generate],
   (void) yyvaluep;
 b4_location_if([  (void) yylocationp;
 ])dnl
-
+[
   if (yytype < YYNTOKENS)
     {
-      YYFPRINTF (yyoutput, "token %s (", yytname[[yytype]]);
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 # ifdef YYPRINT
-      YYPRINT (yyoutput, yytoknum[[yytype]], *yyvaluep);
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 # endif
     }
   else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[[yytype]]);
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
+]b4_location_if([  YY_LOCATION_PRINT (yyoutput, *yylocationp);
+  fprintf (yyoutput, ": ");
+])dnl
+[
   switch (yytype)
     {
-m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
-      default:
+]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
+[      default:
         break;
     }
   YYFPRINTF (yyoutput, ")");
 }
-])
+]])