mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
yacc.c: simplify initialization of push parsers
The previous commit ("yacc.c: declare and initialize and the same
time") made b4_initialize_parser_state_variables useless.
* data/skeletons/yacc.c (b4_initialize_parser_state_variables): Inline
into...
(yypstate_clear): here.
This commit is contained in:
@@ -219,26 +219,6 @@ m4_define([b4_declare_parser_state_variables],
|
||||
[ : YYMAXDEPTH])])[;]])])
|
||||
|
||||
|
||||
# b4_initialize_parser_state_variables
|
||||
# ------------------------------------
|
||||
# Initialize these variables.
|
||||
m4_define([b4_initialize_parser_state_variables],
|
||||
[[ yynerrs = 0;
|
||||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
|
||||
yystacksize = YYINITDEPTH;
|
||||
yyssp = yyss = yyssa;
|
||||
yyvsp = yyvs = yyvsa;]b4_locations_if([[
|
||||
yylsp = yyls = yylsa;]])[]b4_lac_if([[
|
||||
|
||||
yyes = yyesa;
|
||||
yyes_capacity = ]b4_percent_define_get([[parse.lac.es-capacity-initial]])[;
|
||||
if (YYMAXDEPTH < yyes_capacity)
|
||||
yyes_capacity = YYMAXDEPTH;]])[
|
||||
]])
|
||||
|
||||
|
||||
m4_define([b4_macro_define],
|
||||
[[#]define $1 $2])
|
||||
|
||||
@@ -1479,7 +1459,19 @@ yypull_parse (yypstate *yyps]b4_user_formals[)
|
||||
static void
|
||||
yypstate_clear (yypstate *yyps)
|
||||
{
|
||||
]b4_initialize_parser_state_variables[
|
||||
yynerrs = 0;
|
||||
yystate = 0;
|
||||
yyerrstatus = 0;
|
||||
|
||||
yystacksize = YYINITDEPTH;
|
||||
yyssp = yyss = yyssa;
|
||||
yyvsp = yyvs = yyvsa;]b4_locations_if([[
|
||||
yylsp = yyls = yylsa;]])[]b4_lac_if([[
|
||||
|
||||
yyes = yyesa;
|
||||
yyes_capacity = ]b4_percent_define_get([[parse.lac.es-capacity-initial]])[;
|
||||
if (YYMAXDEPTH < yyes_capacity)
|
||||
yyes_capacity = YYMAXDEPTH;]])[
|
||||
/* Initialize the state stack, in case yypcontext_expected_tokens is
|
||||
called before the first call to yyparse. */
|
||||
*yyssp = 0;
|
||||
|
||||
Reference in New Issue
Block a user