Index: Makefile.am =================================================================== RCS file: /sources/bison/bison/src/Makefile.am,v retrieving revision 1.71 diff -u -r1.71 Makefile.am --- Makefile.am 15 Sep 2006 18:59:40 -0000 1.71 +++ Makefile.am 28 Sep 2006 20:27:46 -0000 @@ -65,8 +65,8 @@ system.h \ tables.h tables.c \ uniqstr.c uniqstr.h \ - vcg.c vcg.h \ - vcg_defaults.h + graphviz.c graphviz.h \ + graphviz_defaults.h EXTRA_bison_SOURCES = scan-code.l scan-skel.l scan-gram.l Index: files.c =================================================================== RCS file: /sources/bison/bison/src/files.c,v retrieving revision 1.96 diff -u -r1.96 files.c --- files.c 9 Jul 2006 03:44:51 -0000 1.96 +++ files.c 28 Sep 2006 20:27:46 -0000 @@ -323,7 +323,7 @@ if (graph_flag) { if (! spec_graph_file) - spec_graph_file = concat2 (all_but_tab_ext, ".vcg"); + spec_graph_file = concat2 (all_but_tab_ext, ".dot"); name[names++] = spec_graph_file; } Index: print_graph.c =================================================================== RCS file: /sources/bison/bison/src/print_graph.c,v retrieving revision 1.61 diff -u -r1.61 print_graph.c --- print_graph.c 10 Jun 2006 03:02:23 -0000 1.61 +++ print_graph.c 28 Sep 2006 20:27:46 -0000 @@ -36,7 +36,7 @@ #include "reader.h" #include "state.h" #include "symtab.h" -#include "vcg.h" +#include "graphviz.h" static graph static_graph; static FILE *fgraph = NULL; @@ -127,7 +127,7 @@ transitions *trans = s->transitions; reductions *reds = s->reductions; - static char buff[10]; + static char buff[16]; edge e; if (!trans->num && !reds) @@ -141,19 +141,17 @@ new_edge (&e); - if (s->number > s1->number) - e.type = back_edge; - open_edge (&e, fgraph); + open_edge (fgraph); /* The edge source is the current node. */ e.sourcename = node_name; - sprintf (buff, "%d", s1->number); + sprintf (buff, "state_%d", s1->number); e.targetname = buff; /* Shifts are blue, gotos are green, and error is red. */ if (TRANSITION_IS_ERROR (trans, i)) - e.color = red; + e.attrs.color = red; else - e.color = TRANSITION_IS_SHIFT (trans, i) ? blue : green; - e.label = symbols[sym]->tag; + e.attrs.color = TRANSITION_IS_SHIFT (trans, i) ? blue : green; + e.attrs.label = symbols[sym]->tag; output_edge (&e, fgraph); close_edge (fgraph); } @@ -168,18 +166,21 @@ static void print_state (state *s) { - static char name[10]; + static char name[16]; struct obstack node_obstack; node n; /* The labels of the nodes are their the items. */ obstack_init (&node_obstack); new_node (&n); - sprintf (name, "%d", s->number); + sprintf (name, "state_%d", s->number); n.title = name; + if(s->number == final_state->number) + n.attrs.shape = doublecircle; + print_core (&node_obstack, s); obstack_1grow (&node_obstack, '\0'); - n.label = obstack_finish (&node_obstack); + n.attrs.label = obstack_finish (&node_obstack); open_node (fgraph); output_node (&n, fgraph); @@ -201,15 +202,12 @@ fgraph = xfopen (spec_graph_file, "w"); new_graph (&static_graph); + static_graph.title = "Automaton"; + static_graph.graph_attributes.orientation = left_to_right; + static_graph.graph_attributes.splines = yes; + static_graph.graph_attributes.center = yes; + static_graph.graph_attributes.landscape = yes; - static_graph.display_edge_labels = yes; - - static_graph.port_sharing = no; - static_graph.finetuning = yes; - static_graph.priority_phase = yes; - static_graph.splines = yes; - - static_graph.crossing_weight = median; /* Output graph options. */ open_graph (fgraph); @@ -222,6 +220,6 @@ free_closure (); /* Close graph. */ - close_graph (&static_graph, fgraph); + close_graph (fgraph); xfclose (fgraph); }