parser: reprecate %nterm back

After having spent quite some time on cleaning the handling of symbol
declarations in the grammar files, I believe we should keep it.

It looks like it's a duplicate of %type, but it is not.  While POSIX
Yacc requires %type to apply only to nonterminal symbols, it appears
that both byacc and bison accept it for tokens too.  And some
experienced users do actually expect this feature to group
symbols (terminal or not) by type ("On the other hand, it is generally
more useful IMHO to group terminals and non-terminals with the same
type tag together",
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00000.html).
Even Bison's own parser does this today (see CHAR).

Basically reverts 7928c3e6fb.

* src/scan-gram.l (%nterm): Dedeprecate, but issue a Wyacc warning.
* tests/input.at: Adjust expectations.
(Yacc warnings  on symbols): New.
* src/symtab.c (symbol_class_set): Fix error introduced in
20b0746793.
This commit is contained in:
Akim Demaille
2018-12-13 08:19:54 +01:00
parent dbb855895f
commit aadf6c0bf3
5 changed files with 27 additions and 33 deletions

4
NEWS
View File

@@ -19,10 +19,6 @@ GNU Bison NEWS
** Deprecated features
The directive %nterm, an historical heritage from an ancestor of Bison,
was never officially documented. Its use now triggers warnings.
Eventually, support will be removed. Use %type instead.
The use of the %error-verbose directive is deprecated in favor of "%define
parse.error verbose" since Bison 3.0, but no warning was issued.