c++: give public access to the symbol kind

symbol_type::token () was removed: it returned the token kind of a
symbol.  To do that, one needs to convert from the symbol kind to the
token kind, which requires a table.

This broke some users' unit tests for scanners, see
https://lists.gnu.org/r/bug-bison/2020-01/msg00001.html
https://lists.gnu.org/r/bug-bison/2020-03/msg00020.html
https://lists.gnu.org/r/help-bison/2020-04/msg00005.html

Instead of making this possible again, let's check the symbol's kind
instead.  So give proper access to a symbol's kind.

That feature existed, undocumented, as 'type_get()'.  Let's rename
this as 'kind()'.

* data/skeletons/c++.m4, data/skeletons/glr.cc,
* data/skeletons/lalr1.cc (type_get): Rename as...
(kind): This.
(type_get): Install a backward compatibility alias.
* doc/bison.texi (Complete Symbols): Document symbol_type and
symbol_type::kind.
This commit is contained in:
Akim Demaille
2020-04-17 08:51:18 +02:00
parent e86b14069d
commit d6ae95fb50
6 changed files with 67 additions and 35 deletions

1
TODO
View File

@@ -16,7 +16,6 @@
** Documentation
- YYERRCODE, YYUNDEF, YYEOF
- symbol.type_get should be kind_get, and it's not documented.
- YYERRCODE and translation
** Java