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 <mingew...@gmail.com> 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 _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison