glr.cc: support syntax_error exceptions

Kindly requested by Аскар Сафин (Askar Safin).
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00033.html

* data/skeletons/glr.c (b4_glr_cc_if): New.
Use it.
(yygetToken): Catch syntax_errors.
* data/skeletons/glr.cc (YY_EXCEPTIONS): New.
* tests/c++.at: Check it.
This commit is contained in:
Akim Demaille
2018-12-30 12:07:30 +01:00
parent 6653c912da
commit 90a8537e62
5 changed files with 63 additions and 6 deletions

10
TODO
View File

@@ -7,6 +7,11 @@ Several features are not available in all the backends.
- token constructors: Java and C
* Short term
** glr.c: too many definitions of YYLLOC_DEFAULT
See test 241.
241. headers.at:187: testing Sane headers: %locations c++ %glr-parser ...
** consistency
token vs terminal
@@ -108,6 +113,11 @@ since it is no longer bound to a particular parser, it's just a
as lr0.cc, why upper case?
* Various
** Rewrite glr.cc in C++
As a matter of fact, it would be very interesting to see how much we can
share between lalr1.cc and glr.cc. Most of the skeletons should be common.
It would be a very nice source of inspiration for the other languages.
** YYERRCODE
Defined to 256, but not used, not documented. Probably the token
number for the error token, which POSIX wants to be 256, but which