mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
YYACCEPT, YYERROR, and YYABORT, as user actions, should not
destroy the RHS symbols of a rule. * data/yacc.c (yylen): Initialize to 0. Keep its value to the number of items to possibly shift. In particular, a regular successful parse that ends on YYFINAL by a (internal) YYACCEPT must not have yylen != 0. (yyerrorlab, yyreturn): Pop the RHS. Reorder a bit to emphasize the `shifting' bits of code. (YYPOPSTACK): Now accept a number of items to pop. * data/lalr1.cc: Likewise. * data/glr.c: Formatting changes. Use goto instead of fall through. * doc/bison.texinfo (Destructor Decl): Complete.
This commit is contained in:
16
ChangeLog
16
ChangeLog
@@ -1,3 +1,19 @@
|
|||||||
|
2005-12-21 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
YYACCEPT, YYERROR, and YYABORT, as user actions, should not
|
||||||
|
destroy the RHS symbols of a rule.
|
||||||
|
* data/yacc.c (yylen): Initialize to 0.
|
||||||
|
Keep its value to the number of items to possibly shift.
|
||||||
|
In particular, a regular successful parse that ends on YYFINAL by
|
||||||
|
a (internal) YYACCEPT must not have yylen != 0.
|
||||||
|
(yyerrorlab, yyreturn): Pop the RHS.
|
||||||
|
Reorder a bit to emphasize the `shifting' bits of code.
|
||||||
|
(YYPOPSTACK): Now accept a number of items to pop.
|
||||||
|
* data/lalr1.cc: Likewise.
|
||||||
|
* data/glr.c: Formatting changes.
|
||||||
|
Use goto instead of fall through.
|
||||||
|
* doc/bison.texinfo (Destructor Decl): Complete.
|
||||||
|
|
||||||
2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
|
2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
|
||||||
|
|
||||||
* Makefile.am: DJGPP specific files added to EXTRA_DIST.
|
* Makefile.am: DJGPP specific files added to EXTRA_DIST.
|
||||||
|
|||||||
5
NEWS
5
NEWS
@@ -3,6 +3,11 @@ Bison News
|
|||||||
|
|
||||||
Changes in version 2.1a:
|
Changes in version 2.1a:
|
||||||
|
|
||||||
|
* %destructor vs. YYACCEPT, YYERROR, and YYABORT.
|
||||||
|
When the parsing/action is cut by the user using one of these
|
||||||
|
special actions, the stack is freed except the right-hand side
|
||||||
|
symbols of the current rule.
|
||||||
|
|
||||||
* GLR, C++ LALR(1) parsers.
|
* GLR, C++ LALR(1) parsers.
|
||||||
These parser skeletons are now distributed with the same special
|
These parser skeletons are now distributed with the same special
|
||||||
license exception that the C LALR(1) parser skeleton has had since
|
license exception that the C LALR(1) parser skeleton has had since
|
||||||
|
|||||||
16
data/glr.c
16
data/glr.c
@@ -909,10 +909,12 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
|||||||
*yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
|
*yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
|
||||||
YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen);
|
YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen);
|
||||||
]b4_location_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
|
]b4_location_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
|
||||||
]])
|
]])[
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
b4_actions
|
]b4_actions
|
||||||
|
/* Line __line__ of glr.c. */
|
||||||
|
b4_syncline([@oline@], [@ofile@])[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -924,8 +926,6 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
|||||||
# undef YYBACKUP
|
# undef YYBACKUP
|
||||||
# undef yyclearin
|
# undef yyclearin
|
||||||
# undef YYRECOVERING
|
# undef YYRECOVERING
|
||||||
/* Line __line__ of glr.c. */
|
|
||||||
b4_syncline([@oline@], [@ofile@])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -937,11 +937,11 @@ yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
|
|||||||
|
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
b4_mergers
|
]b4_mergers[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[
|
|
||||||
/* Bison grammar-table manipulation. */
|
/* Bison grammar-table manipulation. */
|
||||||
|
|
||||||
]b4_yydestruct_generate([b4_c_ansi_function_def])[
|
]b4_yydestruct_generate([b4_c_ansi_function_def])[
|
||||||
@@ -2324,7 +2324,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
|||||||
|
|
||||||
yybuglab:
|
yybuglab:
|
||||||
YYASSERT (yyfalse);
|
YYASSERT (yyfalse);
|
||||||
/* Fall through. */
|
goto yyabortlab;
|
||||||
|
|
||||||
yyabortlab:
|
yyabortlab:
|
||||||
yyresult = 1;
|
yyresult = 1;
|
||||||
@@ -2333,7 +2333,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
|
|||||||
yyexhaustedlab:
|
yyexhaustedlab:
|
||||||
yyerror (]b4_lyyerror_args[YY_("memory exhausted"));
|
yyerror (]b4_lyyerror_args[YY_("memory exhausted"));
|
||||||
yyresult = 2;
|
yyresult = 2;
|
||||||
/* Fall through. */
|
goto yyreturn;
|
||||||
|
|
||||||
yyreturn:
|
yyreturn:
|
||||||
if (yytoken != YYEOF && yytoken != YYEMPTY)
|
if (yytoken != YYEOF && yytoken != YYEMPTY)
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ namespace yy
|
|||||||
|
|
||||||
/* State. */
|
/* State. */
|
||||||
int yyn;
|
int yyn;
|
||||||
int yylen;
|
int yylen = 0;
|
||||||
int yystate = 0;
|
int yystate = 0;
|
||||||
|
|
||||||
/* Error handling. */
|
/* Error handling. */
|
||||||
@@ -641,7 +641,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
`-----------------------------*/
|
`-----------------------------*/
|
||||||
yyreduce:
|
yyreduce:
|
||||||
yylen = yyr2_[yyn];
|
yylen = yyr2_[yyn];
|
||||||
/* If LEN_ is nonzero, implement the default value of the action:
|
/* If YYLEN is nonzero, implement the default value of the action:
|
||||||
`$$ = $1'. Otherwise, use the top of the stack.
|
`$$ = $1'. Otherwise, use the top of the stack.
|
||||||
|
|
||||||
Otherwise, the following line sets YYVAL to garbage.
|
Otherwise, the following line sets YYVAL to garbage.
|
||||||
@@ -659,15 +659,15 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
|
|||||||
YY_REDUCE_PRINT (yyn);
|
YY_REDUCE_PRINT (yyn);
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_actions[
|
]b4_actions
|
||||||
|
/* Line __line__ of lalr1.cc. */
|
||||||
|
b4_syncline([@oline@], [@ofile@])[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
|
||||||
/* Line __line__ of lalr1.cc. */
|
|
||||||
]b4_syncline([@oline@], [@ofile@])[
|
|
||||||
|
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
|
yylen = 0;
|
||||||
YY_STACK_PRINT ();
|
YY_STACK_PRINT ();
|
||||||
|
|
||||||
yysemantic_stack_.push (yyval);
|
yysemantic_stack_.push (yyval);
|
||||||
@@ -731,7 +731,10 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
goto yyerrorlab;
|
goto yyerrorlab;
|
||||||
|
|
||||||
yyerror_range[0] = yylocation_stack_[yylen - 1];
|
yyerror_range[0] = yylocation_stack_[yylen - 1];
|
||||||
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
|
this YYERROR. */
|
||||||
yypop_ (yylen);
|
yypop_ (yylen);
|
||||||
|
yylen = 0;
|
||||||
yystate = yystate_stack_[0];
|
yystate = yystate_stack_[0];
|
||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
|
|
||||||
@@ -799,6 +802,9 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
if (yychar != yyeof_ && yychar != yyempty_)
|
if (yychar != yyeof_ && yychar != yyempty_)
|
||||||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
|
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
|
||||||
|
|
||||||
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
|
this YYABORT or YYACCEPT. */
|
||||||
|
yypop_ (yylen);
|
||||||
while (yystate_stack_.height () != 1)
|
while (yystate_stack_.height () != 1)
|
||||||
{
|
{
|
||||||
yydestruct_ ("Cleanup: popping",
|
yydestruct_ ("Cleanup: popping",
|
||||||
|
|||||||
64
data/yacc.c
64
data/yacc.c
@@ -564,7 +564,7 @@ do \
|
|||||||
yychar = (Token); \
|
yychar = (Token); \
|
||||||
yylval = (Value); \
|
yylval = (Value); \
|
||||||
yytoken = YYTRANSLATE (yychar); \
|
yytoken = YYTRANSLATE (yychar); \
|
||||||
YYPOPSTACK; \
|
YYPOPSTACK (1); \
|
||||||
goto yybackup; \
|
goto yybackup; \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
@@ -1042,7 +1042,7 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
|||||||
/* The locations where the error started and ended. */
|
/* The locations where the error started and ended. */
|
||||||
YYLTYPE yyerror_range[2];]])[
|
YYLTYPE yyerror_range[2];]])[
|
||||||
|
|
||||||
#define YYPOPSTACK (yyvsp--, yyssp--]b4_location_if([, yylsp--])[)
|
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_location_if([, yylsp -= (N)])[)
|
||||||
|
|
||||||
YYSIZE_T yystacksize = YYINITDEPTH;
|
YYSIZE_T yystacksize = YYINITDEPTH;
|
||||||
|
|
||||||
@@ -1051,9 +1051,9 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
|||||||
YYSTYPE yyval;
|
YYSTYPE yyval;
|
||||||
]b4_location_if([ YYLTYPE yyloc;])[
|
]b4_location_if([ YYLTYPE yyloc;])[
|
||||||
|
|
||||||
/* When reducing, the number of symbols on the RHS of the reduced
|
/* The number of symbols on the RHS of the reduced rule.
|
||||||
rule. */
|
Keep to zero when no symbol should be popped off. */
|
||||||
int yylen;
|
int yylen = 0;
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||||
|
|
||||||
@@ -1178,12 +1178,10 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
|||||||
`-----------*/
|
`-----------*/
|
||||||
yybackup:
|
yybackup:
|
||||||
|
|
||||||
/* Do appropriate processing given the current state. */
|
/* Do appropriate processing given the current state. Read a
|
||||||
/* Read a look-ahead token if we need one and don't already have one. */
|
look-ahead token if we need one and don't already have one. */
|
||||||
/* yyresume: */
|
|
||||||
|
|
||||||
/* First try to decide what to do without reference to look-ahead token. */
|
/* First try to decide what to do without reference to look-ahead token. */
|
||||||
|
|
||||||
yyn = yypact[yystate];
|
yyn = yypact[yystate];
|
||||||
if (yyn == YYPACT_NINF)
|
if (yyn == YYPACT_NINF)
|
||||||
goto yydefault;
|
goto yydefault;
|
||||||
@@ -1225,22 +1223,21 @@ yybackup:
|
|||||||
if (yyn == YYFINAL)
|
if (yyn == YYFINAL)
|
||||||
YYACCEPT;
|
YYACCEPT;
|
||||||
|
|
||||||
/* Shift the look-ahead token. */
|
|
||||||
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
|
||||||
|
|
||||||
/* Discard the token being shifted unless it is eof. */
|
|
||||||
if (yychar != YYEOF)
|
|
||||||
yychar = YYEMPTY;
|
|
||||||
|
|
||||||
*++yyvsp = yylval;
|
|
||||||
]b4_location_if([ *++yylsp = yylloc;])[
|
|
||||||
|
|
||||||
/* Count tokens shifted since error; after three, turn off error
|
/* Count tokens shifted since error; after three, turn off error
|
||||||
status. */
|
status. */
|
||||||
if (yyerrstatus)
|
if (yyerrstatus)
|
||||||
yyerrstatus--;
|
yyerrstatus--;
|
||||||
|
|
||||||
|
/* Shift the look-ahead token. */
|
||||||
|
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
||||||
|
|
||||||
|
/* Discard the shifted token unless it is eof. */
|
||||||
|
if (yychar != YYEOF)
|
||||||
|
yychar = YYEMPTY;
|
||||||
|
|
||||||
yystate = yyn;
|
yystate = yyn;
|
||||||
|
*++yyvsp = yylval;
|
||||||
|
]b4_location_if([ *++yylsp = yylloc;])[
|
||||||
goto yynewstate;
|
goto yynewstate;
|
||||||
|
|
||||||
|
|
||||||
@@ -1277,18 +1274,15 @@ yyreduce:
|
|||||||
YY_REDUCE_PRINT (yyn);
|
YY_REDUCE_PRINT (yyn);
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_actions[
|
]b4_actions
|
||||||
|
/* Line __line__ of yacc.c. */
|
||||||
|
b4_syncline([@oline@], [@ofile@])[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||||||
|
|
||||||
/* Line __line__ of yacc.c. */
|
YYPOPSTACK (yylen);
|
||||||
]b4_syncline([@oline@], [@ofile@])[
|
yylen = 0;
|
||||||
|
|
||||||
yyvsp -= yylen;
|
|
||||||
yyssp -= yylen;
|
|
||||||
]b4_location_if([ yylsp -= yylen;])[
|
|
||||||
|
|
||||||
YY_STACK_PRINT (yyss, yyssp);
|
YY_STACK_PRINT (yyss, yyssp);
|
||||||
|
|
||||||
*++yyvsp = yyval;
|
*++yyvsp = yyval;
|
||||||
@@ -1392,9 +1386,11 @@ yyerrorlab:
|
|||||||
goto yyerrorlab;
|
goto yyerrorlab;
|
||||||
|
|
||||||
]b4_location_if([[ yyerror_range[0] = yylsp[1-yylen];
|
]b4_location_if([[ yyerror_range[0] = yylsp[1-yylen];
|
||||||
yylsp -= yylen;
|
]])[ /* Do not reclaim the symbols of the rule which action triggered
|
||||||
]])[yyvsp -= yylen;
|
this YYERROR. */
|
||||||
yyssp -= yylen;
|
YYPOPSTACK (yylen);
|
||||||
|
yylen = 0;
|
||||||
|
YY_STACK_PRINT (yyss, yyssp);
|
||||||
yystate = *yyssp;
|
yystate = *yyssp;
|
||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
|
|
||||||
@@ -1426,7 +1422,7 @@ yyerrlab1:
|
|||||||
]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
|
]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
|
||||||
yydestruct ("Error: popping",
|
yydestruct ("Error: popping",
|
||||||
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
|
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
|
||||||
YYPOPSTACK;
|
YYPOPSTACK (1);
|
||||||
yystate = *yyssp;
|
yystate = *yyssp;
|
||||||
YY_STACK_PRINT (yyss, yyssp);
|
YY_STACK_PRINT (yyss, yyssp);
|
||||||
}
|
}
|
||||||
@@ -1477,11 +1473,15 @@ yyreturn:
|
|||||||
if (yychar != YYEOF && yychar != YYEMPTY)
|
if (yychar != YYEOF && yychar != YYEMPTY)
|
||||||
yydestruct ("Cleanup: discarding lookahead",
|
yydestruct ("Cleanup: discarding lookahead",
|
||||||
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
|
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
|
||||||
|
/* Do not reclaim the symbols of the rule which action triggered
|
||||||
|
this YYABORT or YYACCEPT. */
|
||||||
|
YYPOPSTACK (yylen);
|
||||||
|
YY_STACK_PRINT (yyss, yyssp);
|
||||||
while (yyssp != yyss)
|
while (yyssp != yyss)
|
||||||
{
|
{
|
||||||
yydestruct ("Cleanup: popping",
|
yydestruct ("Cleanup: popping",
|
||||||
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
|
yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
|
||||||
YYPOPSTACK;
|
YYPOPSTACK (1);
|
||||||
}
|
}
|
||||||
#ifndef yyoverflow
|
#ifndef yyoverflow
|
||||||
if (yyss != yyssa)
|
if (yyss != yyssa)
|
||||||
|
|||||||
@@ -3810,20 +3810,20 @@ For instance, if your locations use a file name, you may use
|
|||||||
@cindex freeing discarded symbols
|
@cindex freeing discarded symbols
|
||||||
@findex %destructor
|
@findex %destructor
|
||||||
|
|
||||||
Some symbols can be discarded by the parser. During error recovery
|
During error recovery (@pxref{Error Recovery}), symbols already pushed
|
||||||
(@pxref{Error Recovery}), symbols already pushed on the stack and tokens
|
on the stack and tokens coming from the rest of the file are discarded
|
||||||
coming from the rest of the file are discarded until the parser falls on
|
until the parser falls on its feet. If the parser runs out of memory,
|
||||||
its feet. If the parser runs out of memory, all the symbols on the
|
or if the parsing is cut by @code{YYACCEPT} or @code{YYABORT}, all the
|
||||||
stack must be discarded. Even if the parser succeeds, it must discard
|
symbols on the stack must be discarded. Even if the parser succeeds, it
|
||||||
the start symbol.
|
must discard the start symbol.
|
||||||
|
|
||||||
When discarded symbols convey heap based information, this memory is
|
When discarded symbols convey heap based information, this memory is
|
||||||
lost. While this behavior can be tolerable for batch parsers, such as
|
lost. While this behavior can be tolerable for batch parsers, such as
|
||||||
in traditional compilers, it is unacceptable for programs like shells or
|
in traditional compilers, it is unacceptable for programs like shells or
|
||||||
protocol implementations that may parse and execute indefinitely.
|
protocol implementations that may parse and execute indefinitely.
|
||||||
|
|
||||||
The @code{%destructor} directive defines code that
|
The @code{%destructor} directive defines code that is called when a
|
||||||
is called when a symbol is discarded.
|
symbol is automatically discarded.
|
||||||
|
|
||||||
@deffn {Directive} %destructor @{ @var{code} @} @var{symbols}
|
@deffn {Directive} %destructor @{ @var{code} @} @var{symbols}
|
||||||
@findex %destructor
|
@findex %destructor
|
||||||
@@ -3832,10 +3832,6 @@ Within @var{code}, @code{$$} designates the semantic value associated
|
|||||||
with the discarded symbol. The additional parser parameters are also
|
with the discarded symbol. The additional parser parameters are also
|
||||||
available (@pxref{Parser Function, , The Parser Function
|
available (@pxref{Parser Function, , The Parser Function
|
||||||
@code{yyparse}}).
|
@code{yyparse}}).
|
||||||
|
|
||||||
@strong{Warning:} as of Bison 2.1, this feature is still
|
|
||||||
experimental, as there has not been enough user feedback. In particular,
|
|
||||||
the syntax might still change.
|
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
For instance:
|
For instance:
|
||||||
@@ -3854,24 +3850,6 @@ For instance:
|
|||||||
guarantees that when a @code{STRING} or a @code{string} is discarded,
|
guarantees that when a @code{STRING} or a @code{string} is discarded,
|
||||||
its associated memory will be freed.
|
its associated memory will be freed.
|
||||||
|
|
||||||
Note that in the future, Bison might also consider that right hand side
|
|
||||||
members that are not mentioned in the action can be destroyed. For
|
|
||||||
instance, in:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
comment: "/*" STRING "*/";
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@noindent
|
|
||||||
the parser is entitled to destroy the semantic value of the
|
|
||||||
@code{string}. Of course, this will not apply to the default action;
|
|
||||||
compare:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
typeless: string; // $$ = $1 does not apply; $1 is destroyed.
|
|
||||||
typefull: string; // $$ = $1 applies, $1 is not destroyed.
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@sp 1
|
@sp 1
|
||||||
|
|
||||||
@cindex discarded symbols
|
@cindex discarded symbols
|
||||||
@@ -3883,13 +3861,18 @@ stacked symbols popped during the first phase of error recovery,
|
|||||||
@item
|
@item
|
||||||
incoming terminals during the second phase of error recovery,
|
incoming terminals during the second phase of error recovery,
|
||||||
@item
|
@item
|
||||||
the current look-ahead and the entire stack when the parser aborts
|
the current look-ahead and the entire stack (except the current
|
||||||
(either via an explicit call to @code{YYABORT}, or as a consequence of
|
right-hand side symbols) when the parser aborts (either via an explicit
|
||||||
a failed error recovery or of memory exhaustion), and
|
call to @code{YYABORT} or @code{YYACCEPT}, or as a consequence of a
|
||||||
|
failed error recovery or of memory exhaustion), and
|
||||||
@item
|
@item
|
||||||
the start symbol, when the parser succeeds.
|
the start symbol, when the parser succeeds.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
|
Note that right-hand size symbols of a rule that explicitly triggers a
|
||||||
|
syntax error via @code{YYERROR} are not reclaimed. As a thumb rule,
|
||||||
|
destructors are invoked only when you do not have other means to manage
|
||||||
|
the memory.
|
||||||
|
|
||||||
@node Expect Decl
|
@node Expect Decl
|
||||||
@subsection Suppressing Conflict Warnings
|
@subsection Suppressing Conflict Warnings
|
||||||
|
|||||||
Reference in New Issue
Block a user