* src/files.c [VMS]: No longer include `ssdef.h', no longer define
[bison.git] / src / print.c
index bf3fce87f05a661dadee565eee472a5d7c447904..5f9ad9b6ff14b91bcaa8eb07f550c98c43021023 100644 (file)
 
 
 #include "system.h"
-#include "alloc.h"
+#include "xalloc.h"
 #include "files.h"
 #include "gram.h"
-#include "state.h"
+#include "LR0.h"
 #include "lalr.h"
 #include "conflicts.h"
 #include "getargs.h"
 #include "state.h"
-
-extern char **tags;
-extern int final_state;
+#include "reader.h"
+#include "print.h"
 
 #if 0
 static void
@@ -195,7 +194,9 @@ print_actions (int state)
 static void
 print_state (int state)
 {
-  fprintf (foutput, _("\n\nstate %d\n\n"), state);
+  fputs ("\n\n", foutput);
+  fprintf (foutput, _("state %d"), state);
+  fputs ("\n\n", foutput);
   print_core (state);
   print_actions (state);
 }
@@ -223,7 +224,9 @@ print_grammar (void)
   int column = 0;
 
   /* rule # : LHS -> RHS */
-  fputs (_("\nGrammar\n"), foutput);
+  putc ('\n', foutput);
+  fputs (_("Grammar"), foutput);
+  putc ('\n', foutput);
   for (i = 1; i <= nrules; i++)
     /* Don't print rules disabled in reduce_grammar_tables.  */
     if (rlhs[i] >= 0)
@@ -239,7 +242,9 @@ print_grammar (void)
       }
 
   /* TERMINAL (type #) : rule #s terminal is on RHS */
-  fputs (_("\nTerminals, with rules where they appear\n\n"), foutput);
+  fputs ("\n", foutput);
+  fputs (_("Terminals, with rules where they appear"), foutput);
+  fputs ("\n\n", foutput);
   fprintf (foutput, "%s (-1)\n", tags[0]);
   if (translations)
     {
@@ -287,7 +292,9 @@ print_grammar (void)
        fprintf (foutput, "%s\n", buffer);
       }
 
-  fputs (_("\nNonterminals, with rules where they appear\n\n"), foutput);
+  fputs ("\n", foutput);
+  fputs (_("Nonterminals, with rules where they appear"), foutput);
+  fputs ("\n\n", foutput);
   for (i = ntokens; i <= nsyms - 1; i++)
     {
       int left_count = 0, right_count = 0;
@@ -352,10 +359,10 @@ print_results (void)
   if (any_conflicts)
     print_conflicts ();
 
-  if (verboseflag)
+  if (verbose_flag)
     print_grammar ();
 
-  if (verboseflag)
+  if (verbose_flag)
     for (i = 0; i < nstates; i++)
       print_state (i);
 }