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.
This commit is contained in:
Akim Demaille
2021-02-01 07:54:03 +01:00
parent 47186ec460
commit d50a3e450e
5 changed files with 18 additions and 19 deletions

7
NEWS
View File

@@ -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,

View File

@@ -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}]

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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
])