bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05-fyi-fix-report.patch


From: Akim Demaille
Subject: 05-fyi-fix-report.patch
Date: Mon, 12 Nov 2001 10:06:56 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * src/conflicts.c (print_reductions): Accept OUT as argument.
        Output to it, not to output_obstack.
        * src/print.c (print_actions): Adjust.
        
        
Index: src/conflicts.c
--- src/conflicts.c Sat, 10 Nov 2001 13:30:50 +0100 akim
+++ src/conflicts.c Sat, 10 Nov 2001 13:43:43 +0100 akim
@@ -502,7 +502,7 @@
 
 
 void
-print_reductions (int state)
+print_reductions (FILE *out, int state)
 {
   int i;
   int j;
@@ -580,9 +580,8 @@
       for (i = 0; i < ntokens; i++)
        {
          if (mask & *fp3)
-           obstack_fgrow3 (&output_obstack,
-                           _("    %-4s\t[reduce using rule %d (%s)]\n"),
-                           tags[i], default_rule, tags[rlhs[default_rule]]);
+           fprintf (out, _("    %-4s\t[reduce using rule %d (%s)]\n"),
+                    tags[i], default_rule, tags[rlhs[default_rule]]);
 
          mask <<= 1;
          if (mask == 0)
@@ -592,9 +591,8 @@
            }
        }
 
-      obstack_fgrow2 (&output_obstack,
-                     _("    $default\treduce using rule %d (%s)\n\n"),
-                     default_rule, tags[rlhs[default_rule]]);
+      fprintf (out, _("    $default\treduce using rule %d (%s)\n\n"),
+              default_rule, tags[rlhs[default_rule]]);
     }
   else if (n - m >= 1)
     {
@@ -681,7 +679,7 @@
                      if (j != default_LA)
                        {
                          rule = LAruleno[j];
-                         obstack_fgrow3 (&output_obstack,
+                         fprintf (out,
                                   _("    %-4s\treduce using rule %d (%s)\n"),
                                   tags[i], rule, tags[rlhs[rule]]);
                        }
@@ -695,13 +693,13 @@
                      if (defaulted)
                        {
                          rule = LAruleno[default_LA];
-                         obstack_fgrow3 (&output_obstack,
+                         fprintf (out,
                                   _("    %-4s\treduce using rule %d (%s)\n"),
                                   tags[i], rule, tags[rlhs[rule]]);
                          defaulted = 0;
                        }
                      rule = LAruleno[j];
-                     obstack_fgrow3 (&output_obstack,
+                     fprintf (out,
                               _("    %-4s\t[reduce using rule %d (%s)]\n"),
                               tags[i], rule, tags[rlhs[rule]]);
                    }
@@ -722,11 +720,8 @@
        }
 
       if (default_LA >= 0)
-       obstack_fgrow2 (&output_obstack,
-                       _("    $default\treduce using rule %d (%s)\n"),
-                       default_rule, tags[rlhs[default_rule]]);
-
-      obstack_1grow (&output_obstack, '\n');
+       fprintf (out, _("    $default\treduce using rule %d (%s)\n"),
+                default_rule, tags[rlhs[default_rule]]);
     }
 }
 
Index: src/conflicts.h
--- src/conflicts.h Sat, 10 Nov 2001 13:30:50 +0100 akim
+++ src/conflicts.h Sat, 10 Nov 2001 13:39:36 +0100 akim
@@ -25,7 +25,7 @@
 void solve_conflicts PARAMS ((void));
 void conflicts_print PARAMS ((void));
 void conflicts_output PARAMS ((FILE *out));
-void print_reductions PARAMS ((int));
+void print_reductions PARAMS ((FILE*out, int state));
 void free_conflicts PARAMS ((void));
 
 /* Were there conflicts? */
Index: src/print.c
--- src/print.c Sat, 10 Nov 2001 13:30:50 +0100 akim
+++ src/print.c Sat, 10 Nov 2001 13:40:54 +0100 akim
@@ -173,7 +173,7 @@
     }
   else if (redp)
     {
-      print_reductions (state);
+      print_reductions (out, state);
     }
 
   if (i < k)
Index: tests/regression.at
--- tests/regression.at Sat, 10 Nov 2001 13:30:50 +0100 akim
+++ tests/regression.at Sat, 10 Nov 2001 13:44:47 +0100 akim
@@ -123,6 +123,9 @@ exp: exp OP exp | NUM;
 
     OP         shift, and go to state 3
 
+    OP         [reduce using rule 1 (exp)]
+    $default   reduce using rule 1 (exp)
+
 
 
 state 5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]