c++: rename semantic_type as value_type

We always refer to the triplet "kind, value, location".  All of them
are nouns, and we support api.value.type and api.location.type.  On
this regard, "semantic_type" was a poor choice.  Make it "value_type".

The test suite was not updated to use value_type, on purpose, to
enforce backward compatibility.

* data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/glr2.cc,
* data/skeletons/variant.hh, doc/bison.texi: Define value_type rather
than semantic_type.
Add a backward compatibility typedef.
* examples/c++/glr/c++-types.yy: Migrate.
This commit is contained in:
Akim Demaille
2020-12-26 08:21:50 +01:00
parent 59653c8efd
commit 2157ced3dd
7 changed files with 63 additions and 56 deletions

27
NEWS
View File

@@ -4,22 +4,27 @@ GNU Bison NEWS
** Changes
*** C++ value_type
Prefer value_type to semantic_type to denote the semantic value type,
specified by the `api.value.type` %define variable.
** New features
*** Option -H, --header and directive %header
The option -H/--header supersedes the option --defines, and the directive
%header supersedes %defines. Both --defines and %defines are, of course,
maintained for backward compatibility.
The option `-H`/`--header` supersedes the option `--defines`, and the
directive %header supersedes %defines. Both `--defines` and `%defines`
are, of course, maintained for backward compatibility.
*** Option --html
Since version 2.4 Bison can be used to generate HTML reports. However it
was a two-step process: first bison must be invoked with option --xml, and
then xsltproc must be run to the convert the XML reports into HTML.
was a two-step process: first bison must be invoked with option `--xml`,
and then xsltproc must be run to the convert the XML reports into HTML.
The new option --html combines these steps. The xsltproc program must be
available.
The new option `--html` combines these steps. The xsltproc program must
be available.
*** A C++ native GLR parser
@@ -51,8 +56,8 @@ GNU Bison NEWS
*** Lookahead correction in Java
The Java skeleton (lalr1.java) now supports LAC, via the %define variable
parse.lac.
The Java skeleton (lalr1.java) now supports LAC, via the `parse.lac`
%define variable.
* Noteworthy changes in release 3.7.4 (2020-11-14) [stable]
@@ -795,7 +800,7 @@ GNU Bison NEWS
Also, because string aliases need not be defined, typos such as "baz"
instead of "bar" will be not reported.
The option -Wdangling-alias catches these situations. On
The option `-Wdangling-alias` catches these situations. On
%token BAR "bar"
%type <ival> foo "foo"
@@ -811,7 +816,7 @@ GNU Bison NEWS
| foo: "baz" {}
| ^~~~~
The -Wall option does not (yet?) include -Wdangling-alias.
The `-Wall` option does not (yet?) include `-Wdangling-alias`.
*** Better POSIX Yacc compatibility diagnostics