#include "alloc.h"
#include "files.h"
#include "gram.h"
-#include "state.h"
+#include "LR0.h"
#include "lalr.h"
-
-extern char **tags;
-extern int nstates;
-extern errs **err_table;
-extern char any_conflicts;
-extern char *conflicts;
-extern int final_state;
-
-extern void conflict_log PARAMS ((void));
-extern void verbose_conflict_log PARAMS ((void));
-extern void print_reductions PARAMS ((int));
-
-extern void terse PARAMS ((void));
-extern void verbose PARAMS ((void));
-
-#if 0 /* XXX currently unused. */
-static void print_token PARAMS ((int, int));
-#endif
-
-static void print_state PARAMS ((int));
-static void print_core PARAMS ((int));
-static void print_actions PARAMS ((int));
-static void print_grammar PARAMS ((void));
-
-void
-terse (void)
-{
- if (any_conflicts)
- conflict_log ();
-}
-
-
-void
-verbose (void)
-{
- int i;
-
- if (any_conflicts)
- verbose_conflict_log ();
-
- print_grammar ();
-
- for (i = 0; i < nstates; i++)
- print_state (i);
-}
+#include "conflicts.h"
+#include "getargs.h"
+#include "state.h"
+#include "reader.h"
-#if 0 /* XXX currently unused. */
+#if 0
static void
print_token (int extnum, int token)
{
}
#endif
-
-static void
-print_state (int state)
-{
- fprintf (foutput, _("\n\nstate %d\n\n"), state);
- print_core (state);
- print_actions (state);
-}
-
+\f
+/*================================\
+| Report information on a state. |
+\================================*/
static void
print_core (int state)
putc ('\n', foutput);
}
-
static void
print_actions (int state)
{
}
}
+static void
+print_state (int state)
+{
+ fprintf (foutput, _("\n\nstate %d\n\n"), state);
+ print_core (state);
+ print_actions (state);
+}
+\f
+/*-----------------------------------------.
+| Print information on the whole grammar. |
+`-----------------------------------------*/
+
#define END_TEST(end) \
do { \
if (column + strlen(buffer) > (end)) { \
} \
} while (0)
+
static void
print_grammar (void)
{
fprintf (foutput, "%s\n", buffer);
}
}
+\f
+void
+print_results (void)
+{
+ int i;
+
+ if (any_conflicts)
+ print_conflicts ();
+
+ if (verboseflag)
+ print_grammar ();
+
+ if (verboseflag)
+ for (i = 0; i < nstates; i++)
+ print_state (i);
+}