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

View File

@@ -163,8 +163,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
}
]b4_parser_class_name::~b4_parser_class_name[ ()
{
}
{}
int
]b4_parser_class_name[::operator() ()
@@ -257,6 +256,15 @@ b4_percent_code_get([[requires]])[
]b4_null_define[
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS
# define YY_EXCEPTIONS 0
# else
# define YY_EXCEPTIONS 1
# endif
#endif
]b4_YYDEBUG_define[
]b4_namespace_open[