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:25:31 -0400

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


reply via email to

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