X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d0a304384f4207bdf7f8b1038c2226c312f5e954..06ec0105b12cdfa2994283e345154e6720354808:/src/print_graph.c
diff --git a/src/print_graph.c b/src/print_graph.c
index 5aa3cc62..31e0e382 100644
--- a/src/print_graph.c
+++ b/src/print_graph.c
@@ -18,7 +18,6 @@
along with this program. If not, see . */
#include
-#include
#include "system.h"
#include "LR0.h"
@@ -58,6 +57,7 @@ print_lhs (struct obstack *oout, rule *previous_rule, rule *r)
obstack_sgrow (oout, escape (r->lhs->tag));
obstack_1grow (oout, ':');
}
+ obstack_1grow (oout, ' ');
}
static void
@@ -77,7 +77,7 @@ print_core (struct obstack *oout, state *s)
}
obstack_printf (oout, _("State %d"), s->number);
- obstack_sgrow (oout, "\\n");
+ obstack_sgrow (oout, "\\n\\l");
for (i = 0; i < snritems; i++)
{
item_number *sp;
@@ -98,7 +98,7 @@ print_core (struct obstack *oout, state *s)
for (sp = rules[r].rhs; sp < sp1; sp++)
obstack_printf (oout, "%s ", escape (symbols[*sp]->tag));
- obstack_sgrow (oout, " .");
+ obstack_1grow (oout, '.');
for (/* Nothing */; *sp >= 0; ++sp)
obstack_printf (oout, " %s", escape (symbols[*sp]->tag));
@@ -143,9 +143,6 @@ print_actions (state const *s, FILE *fgraph)
transitions const *trans = s->transitions;
int i;
- /* Display reductions. */
- output_red (s, s->reductions, fgraph);
-
if (!trans->num && !s->reductions)
return;
@@ -168,6 +165,8 @@ print_actions (state const *s, FILE *fgraph)
TRANSITION_IS_ERROR (trans, i) ? NULL : symbols[sym]->tag,
style, fgraph);
}
+ /* Display reductions. */
+ output_red (s, s->reductions, fgraph);
}