mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
glr.cc: don't "leak" yyparse
When using glr.cc, the C function yyparse is an internal detail that should not be exposed. Users might call it by accident (I did). * data/skeletons/glr.c (yyparse): When used for glr.cc, rename as yy_parse_impl. * data/skeletons/glr.cc: Adjust.
This commit is contained in:
@@ -217,7 +217,7 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[
|
||||
]m4_if(b4_prefix, [yy], [],
|
||||
[[/* Substitute the variable and function names. */
|
||||
#define yyparse ]b4_prefix[parse
|
||||
#define ]b4_glr_cc_if([yy_parse_impl], [yyparse])[ ]b4_prefix[]b4_glr_cc_if([_parse_impl], [parse])[
|
||||
#define yylex ]b4_prefix[lex
|
||||
#define yyerror ]b4_prefix[error
|
||||
#define yydebug ]b4_prefix[debug]]b4_pure_if([], [[
|
||||
@@ -2422,7 +2422,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
`----------*/
|
||||
|
||||
int
|
||||
yyparse (]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param)], [void])[)
|
||||
]b4_glr_cc_if([yy_parse_impl], [yyparse])[ (]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param)], [void])[)
|
||||
{
|
||||
int yyresult;
|
||||
yyGLRStack yystack;
|
||||
|
||||
@@ -144,7 +144,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
int
|
||||
]b4_parser_class[::parse ()
|
||||
{
|
||||
return ::yyparse (*this]b4_user_args[);
|
||||
return ::yy_parse_impl (*this]b4_user_args[);
|
||||
}
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
|
||||
Reference in New Issue
Block a user