bison-patches
[Top][All Lists]
Advanced

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

graph: output foo.gv by default, instead of *.dot


From: Akim Demaille
Subject: graph: output foo.gv by default, instead of *.dot
Date: Tue, 2 Feb 2021 06:52:15 +0100

commit d50a3e450e7e469cee7b6a782b6877ef9e47d7b6
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Mon Feb 1 07:54:03 2021 +0100

    graph: output foo.gv by default, instead of *.dot
    
    That change was started in Bison 3.4.  The announcement for 3.7 stated
    that in Bison 3.8 we would use *.gv by default.
    
    * src/files.c (compute_output_file_names): spec_graph_file defaults
    too *.gv.
    * doc/bison.texi, examples/c++/calc++/local.mk, tests/output.at:
    Adjust.

diff --git a/NEWS b/NEWS
index fe6dda6f7..0c51287bf 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,13 @@ GNU Bison NEWS
 
 ** Changes
 
+*** Graph output
+
+  In conformance with the recommendations of the Graphviz team
+  (https://marc.info/?l=graphviz-devel&m=129418103126092), `-g`/`--graph`
+  now generates a *.gv file by default, instead of *.dot.  A transition
+  started in Bison 3.4.
+
 *** C++ value_type
 
   Prefer value_type to semantic_type to denote the semantic value type,
diff --git a/doc/bison.texi b/doc/bison.texi
index 879d7bd8e..5c59f3582 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -4973,12 +4973,6 @@ Some deprecated behaviors are disabled for some required 
@var{version}:
 @item @code{"3.2"} (or better)
 The C++ deprecated files @file{position.hh} and @file{stack.hh} are no
 longer generated.
-
-@item @code{"3.4"} (or better)
-To comply with the
-@uref{https://marc.info/?l=graphviz-devel&m=129418103126092, recommendations
-of the Graphviz team}, use the @code{.gv} extension instead of @code{.dot}
-for the name of the generated DOT file.  @xref{Graphviz}.
 @end table
 
 
@@ -11870,8 +11864,7 @@ Output a graphical representation of the parser's 
automaton computed by
 Bison, in @uref{https://www.graphviz.org/, Graphviz}
 @uref{https://www.graphviz.org/doc/info/lang.html, DOT} format.
 @code{@var{file}} is optional.  If omitted and the grammar file is
-@file{foo.y}, the output file will be @file{foo.gv} if the @code{%required}
-version is 3.4 or better, @file{foo.dot} otherwise.
+@file{foo.y}, the output file will be @file{foo.gv}.
 
 @item -x [@var{file}]
 @itemx --xml[=@var{file}]
diff --git a/examples/c++/calc++/local.mk b/examples/c++/calc++/local.mk
index abf61e7bc..df3435cbd 100644
--- a/examples/c++/calc++/local.mk
+++ b/examples/c++/calc++/local.mk
@@ -31,7 +31,7 @@ $(calcxx_sources_generated): %D%/parser.stamp
        @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/parser.stamp
 CLEANFILES +=                                  \
   $(calcxx_sources_generated)                  \
-  %D%/parser.dot                               \
+  %D%/parser.gv                                        \
   %D%/parser.output                            \
   %D%/parser.stamp                             \
   %D%/scanner.cc
diff --git a/src/files.c b/src/files.c
index e6af804ee..c0d5d1ca7 100644
--- a/src/files.c
+++ b/src/files.c
@@ -421,8 +421,7 @@ compute_output_file_names (void)
   if (graph_flag)
     {
       if (! spec_graph_file)
-        spec_graph_file = concat2 (all_but_tab_ext,
-                                   304 <= required_version ? ".gv" : ".dot");
+        spec_graph_file = concat2 (all_but_tab_ext, ".gv");
       output_file_name_check (&spec_graph_file, false);
     }
 
diff --git a/tests/output.at b/tests/output.at
index 61be097c8..d17098e29 100644
--- a/tests/output.at
+++ b/tests/output.at
@@ -93,24 +93,24 @@ AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.tab.c],
                 [foo.output foo.tab.c foo.tab.h])
 
 AT_CHECK_OUTPUT([foo.y], [], [--fixed-output-files -dv -g --html],
-                [y.dot y.html y.output y.tab.c y.tab.h y.xml])
+                [y.gv y.html y.output y.tab.c y.tab.h y.xml])
 AT_CHECK_OUTPUT([foo.y], [], [-Hfoo.header -v -gfoo.gv --html=foo.html],
                 [foo.gv foo.header foo.html foo.output foo.tab.c foo.xml])
 
 AT_CHECK_OUTPUT([foo.y], [], [-dv -g --xml --fixed-output-files],
-                [y.dot y.output y.tab.c y.tab.h y.xml])
+                [y.gv y.output y.tab.c y.tab.h y.xml])
 AT_CHECK_OUTPUT([foo.y], [], [-dv -g --xml -y],
-                [y.dot y.output y.tab.c y.tab.h y.xml])
+                [y.gv y.output y.tab.c y.tab.h y.xml])
 AT_CHECK_OUTPUT([foo.y], [%require "3.4"], [-dv -g --xml -y],
                 [y.gv y.output y.tab.c y.tab.h y.xml])
 # With '-o y.tab.c', we expect 'y.output' etc. (for compatibility with Yacc).
 AT_CHECK_OUTPUT([foo.y], [], [-dv -g --xml -o y.tab.c],
-                [y.dot y.output y.tab.c y.tab.h y.xml])
+                [y.gv y.output y.tab.c y.tab.h y.xml])
 
 AT_CHECK_OUTPUT([foo.y], [], [-dv -b bar],
                 [bar.output bar.tab.c bar.tab.h])
 AT_CHECK_OUTPUT([foo.y], [], [-dv -g -o foo.c],
-                [foo.c foo.dot foo.h foo.output])
+                [foo.c foo.gv foo.h foo.output])
 
 
 AT_CHECK_OUTPUT([foo.y], [%header %verbose],      [],
@@ -159,14 +159,14 @@ AT_CHECK_OUTPUT([foo.yy], [],
 # errors).
 AT_CHECK_OUTPUT([foo.y], [%type <foo> useless],
                 [--header --graph --xml --report=all -Wall -Werror],
-                [foo.dot foo.output foo.xml],
+                [foo.gv foo.output foo.xml],
                 [1])
 
 # Do not generate code when there are late errors (even warnings as
 # errors).
 AT_CHECK_OUTPUT([foo.y], [%define useless],
                 [--header --graph --xml --report=all -Wall -Werror],
-                [foo.dot foo.output foo.xml],
+                [foo.gv foo.output foo.xml],
                 [1])
 
 # %header was spelled %defines before.
@@ -350,7 +350,7 @@ m4_pushdef([AT_TEST],
 AT_KEYWORDS([[graph]])
 AT_DATA([[input.y]], [$2])
 AT_BISON_CHECK([[-rall --graph input.y]], [0], [[]], [[ignore]])
-AT_CHECK([[grep -v // input.dot]], [0],
+AT_CHECK([[grep -v // input.gv]], [0],
 [$3])
 AT_CLEANUP
 ])




reply via email to

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