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: Hans Åberg
Subject: Re: About %destructor is c++ mode
Date: Thu, 18 Aug 2016 15:49:31 +0200

> On 18 Aug 2016, at 15:24, Min Wang <address@hidden> 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.





reply via email to

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