bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/6] graphs: style: prefix rules and change shapes


From: Theophile Ranquet
Subject: [PATCH 2/6] graphs: style: prefix rules and change shapes
Date: Wed, 10 Oct 2012 17:14:02 +0000

* src/graphviz.c (start_graph): Use box rather than ellipsis.
* src/print_graph.c (print_core): Prefix rules with their number.
---
 src/graphviz.c    | 1 +
 src/print_graph.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/graphviz.c b/src/graphviz.c
index 46c22a8..c4eaa9f 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 f5695a7..88b2cee 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);
-- 
1.7.11.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]