]> git.saurik.com Git - bison.git/commitdiff
graphs: style: prefix rules and change shapes
authorTheophile Ranquet <theophile.ranquet@gmail.com>
Wed, 10 Oct 2012 17:14:02 +0000 (17:14 +0000)
committerAkim Demaille <akim@lrde.epita.fr>
Thu, 11 Oct 2012 07:31:32 +0000 (09:31 +0200)
* src/graphviz.c (start_graph): Use box rather than ellipsis.
* src/print_graph.c (print_core): Prefix rules with their number.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
src/graphviz.c
src/print_graph.c

index 46c22a8c99423675383a4e6b970c815395e1af8b..c4eaa9f58dbc9f0a59b06d6c5f5b8d6d47139ba9 100644 (file)
@@ -51,6 +51,7 @@ start_graph (FILE *fout)
            "digraph %s\n"
            "{\n",
            quote (grammar_file));
+  fprintf (fout, "node [shape=box]\n");
 }
 
 void
index f5695a7a734951fe65d5d498359f3fd66522292f..88b2ceeabd40e25ba02bdfd9077c5a613a0edfa2 100644 (file)
@@ -68,7 +68,7 @@ print_core (struct obstack *oout, state *s)
 
       r = item_number_as_rule_number (*sp);
 
-      obstack_printf (oout, "\n%s -> ", rules[r].lhs->tag);
+      obstack_printf (oout, "\n%d: %s -> ", r, rules[r].lhs->tag);
 
       for (sp = rules[r].rhs; sp < sp1; sp++)
        obstack_printf (oout, "%s ", symbols[*sp]->tag);