mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +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:
@@ -215,7 +215,7 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
|||||||
#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[
|
#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[
|
||||||
]m4_if(b4_prefix, [yy], [],
|
]m4_if(b4_prefix, [yy], [],
|
||||||
[[/* Substitute the variable and function names. */
|
[[/* 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 yylex ]b4_prefix[lex
|
||||||
#define yyerror ]b4_prefix[error
|
#define yyerror ]b4_prefix[error
|
||||||
#define yydebug ]b4_prefix[debug]]b4_pure_if([], [[
|
#define yydebug ]b4_prefix[debug]]b4_pure_if([], [[
|
||||||
@@ -2420,7 +2420,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
`----------*/
|
`----------*/
|
||||||
|
|
||||||
int
|
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;
|
int yyresult;
|
||||||
yyGLRStack yystack;
|
yyGLRStack yystack;
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
int
|
int
|
||||||
]b4_parser_class[::parse ()
|
]b4_parser_class[::parse ()
|
||||||
{
|
{
|
||||||
return ::yyparse (*this]b4_user_args[);
|
return ::yy_parse_impl (*this]b4_user_args[);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user