help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About %destructor is c++ mode


From: Min Wang
Subject: Re: About %destructor is c++ mode
Date: Thu, 18 Aug 2016 11:38:03 -0400

Hi

just fyi, I just posted the issue in the bug-bison as well.


min

On Thu, Aug 18, 2016 at 11:25 AM, Min Wang <address@hidden> wrote:

> HI
>
>>
>>
>> > My confusion is:  it seems the %destructor is called even for the
>> normal parse!!
>>
>> It should not. But I rely on C++ cleanup, so somebody else will have to
>> tune in here.
>>
>>
>>
> I checked the generated code again:
>
>
> #line 1038 "filter_parser.cpp" // lalr1.cc:859
>       YY_REDUCE_PRINT (yyn);
>
>       try
>
>         {
>
>           switch (yyn)
>
>             {
>                  ....
>             default:
>
>               break;
>
>             }
>
>         }
>
>       catch (const syntax_error& yyexc)
>
>         {
>
>           error (yyexc);
>
>           YYERROR;
>
>         }
>
>       YY_SYMBOL_PRINT ("-> $$ =", yylhs);
>
>       yypop_ (yylen);
>
>       yylen = 0;
>
>       YY_STACK_PRINT ();
>
>
> the normal case will go to:
>
> yypop_ (yylen)  which will call basic_symbol<Base>::clear () -> call 
> %destructor code
>
>
> It seems a defect to me. should I forward to bug-bison?
>
>
>
> min
>
>
>
>
>
>
>
>


-- 
http://www.comrite.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]