HI @Hans. Thanks.
So I should use %type <PROG> PROG instead of %type <PROG*> PROG ? Thus I do not need %destructor at all? thanks. min On Thu, Aug 18, 2016 at 9:49 AM, Hans Åberg <haber...@telia.com> wrote: > > > On 18 Aug 2016, at 15:24, Min Wang <mingew...@gmail.com> wrote: > > > (1) for the error recovery, should I always include "error" in each > rule? > > Only at the place wher e you want to have recovery. > > > what if I do not have error in these rules, does the parser() just return > > failed? it seems it will call that %destructor as well. > > It will unwind the whole stack and terminate. > > > (2) Could you explain more on "rely on C++ cleanup”? > > C++ automatic variables, as the std::string in your first example. The > parser uses std::deque by default, so the C++ destructors are called > properly. > > > -- http://www.comrite.com _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison