On 24 May 2011, at 20:32, Sergey Klimkin wrote:

> Trying to find information about C++ exceptions in semantic actions, with no
> results.
> Is there any Bison %Decl which allows to move parse stack outside yyparse(),
> to destroy a stack values after an exception was thrown within semantic
> action!?

The C++ parser, I recall, is by default pure. So it would not be possible to 
save the stack outside yyparse() unless tweaking the skeleton file. But that 
should be kept to a minium in order to having to update it with new Bison 
releases - it may change.

So you might try the construct
  %code qualifier {code}
(see the Bison manual sec. 3.7.14). I think that qualifier just expands a M4 
macro to {code}. So you might put a try-catch inside yyparse(), and use %code 
to place the catch code.

Hans



_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to