From: Theophile Ranquet Date: Wed, 10 Oct 2012 17:14:02 +0000 (+0000) Subject: graphs: style: prefix rules and change shapes X-Git-Tag: v2.6.90~72 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/2be37f19fe2165fcfd8752a30b55308a5bdb9b84 graphs: style: prefix rules and change shapes * 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 --- diff --git a/src/graphviz.c b/src/graphviz.c index 46c22a8c..c4eaa9f5 100644 --- a/src/graphviz.c +++ b/src/graphviz.c @@ -51,6 +51,7 @@ start_graph (FILE *fout) "digraph %s\n" "{\n", quote (grammar_file)); + fprintf (fout, "node [shape=box]\n"); } void diff --git a/src/print_graph.c b/src/print_graph.c index f5695a7a..88b2ceea 100644 --- a/src/print_graph.c +++ b/src/print_graph.c @@ -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);