mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
glr2.cc: don't publish YY_EXCEPTIONS
We don't need them in the header file. * data/skeletons/glr2.cc (YY_EXCEPTIONS): Define only in the implementation file. * tests/headers.at (Several Parsers): Also check glr2.cc.
This commit is contained in:
@@ -208,15 +208,6 @@ m4_define([b4_shared_declarations],
|
|||||||
[[# include ]b4_location_include])[
|
[[# include ]b4_location_include])[
|
||||||
]b4_variant_if([b4_variant_includes])[
|
]b4_variant_if([b4_variant_includes])[
|
||||||
|
|
||||||
// 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_YYDEBUG_define[
|
||||||
|
|
||||||
class glr_stack;
|
class glr_stack;
|
||||||
@@ -457,6 +448,15 @@ static ]b4_namespace_ref[::]b4_parser_class[::value_type yyval_default;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// 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
|
||||||
|
|
||||||
#ifndef YYFREE
|
#ifndef YYFREE
|
||||||
# define YYFREE free
|
# define YYFREE free
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ exp:
|
|||||||
| 'x' '9' { printf ("x9\n"); }
|
| 'x' '9' { printf ("x9\n"); }
|
||||||
| 'x' 'a' { printf ("xa\n"); }
|
| 'x' 'a' { printf ("xa\n"); }
|
||||||
| 'x' 'b' { printf ("xb\n"); }
|
| 'x' 'b' { printf ("xb\n"); }
|
||||||
|
| 'x' 'c' { printf ("xc\n"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
%%
|
%%
|
||||||
@@ -279,6 +280,7 @@ extern "C"
|
|||||||
#include "x9.hh"
|
#include "x9.hh"
|
||||||
#include "xa.hh"
|
#include "xa.hh"
|
||||||
#include "xb.hh"
|
#include "xb.hh"
|
||||||
|
#include "xc.hh"
|
||||||
|
|
||||||
#define RUN(S) \
|
#define RUN(S) \
|
||||||
do { \
|
do { \
|
||||||
@@ -305,6 +307,8 @@ main (void)
|
|||||||
RUN(pa.parse());
|
RUN(pa.parse());
|
||||||
xb_::parser pb;
|
xb_::parser pb;
|
||||||
RUN(pb.parse());
|
RUN(pb.parse());
|
||||||
|
xc_::parser pc;
|
||||||
|
RUN(pc.parse());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
]])# main.cc
|
]])# main.cc
|
||||||
@@ -320,7 +324,7 @@ AT_TEST([x8], [%define api.pure %define api.push-pull both])
|
|||||||
AT_TEST([x9], [%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %debug %language "c++"])
|
AT_TEST([x9], [%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %debug %language "c++"])
|
||||||
AT_TEST([xa], [%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %language "c++" %define api.value.type variant])
|
AT_TEST([xa], [%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %language "c++" %define api.value.type variant])
|
||||||
AT_TEST([xb], [%locations %define api.location.file none %language "c++" %define api.value.type variant])
|
AT_TEST([xb], [%locations %define api.location.file none %language "c++" %define api.value.type variant])
|
||||||
#AT_TEST([x5], [%locations %language "c++" %glr-parser])
|
AT_TEST([xc], [%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %skeleton "glr2.cc"])
|
||||||
|
|
||||||
# Check that api.prefix works properly:
|
# Check that api.prefix works properly:
|
||||||
#
|
#
|
||||||
@@ -377,7 +381,7 @@ AT_PERL_CHECK([[-n -0777 -e '
|
|||||||
# Do this late, so that other checks have been performed.
|
# Do this late, so that other checks have been performed.
|
||||||
AT_SKIP_IF_CANNOT_LINK_C_AND_CXX
|
AT_SKIP_IF_CANNOT_LINK_C_AND_CXX
|
||||||
|
|
||||||
AT_COMPILE_CXX([parser], [[x[1-9a-b].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
|
AT_COMPILE_CXX([parser], [[x[1-9a-c].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
|
||||||
AT_PARSER_CHECK([parser], [0], [[expout]])
|
AT_PARSER_CHECK([parser], [0], [[expout]])
|
||||||
|
|
||||||
m4_popdef([AT_TEST])
|
m4_popdef([AT_TEST])
|
||||||
|
|||||||
Reference in New Issue
Block a user