Re: bison and C++ exceptions

2011-08-03 Thread John Horigan
It would be nice if YYABORT, YYERROR, and YYACCEPT were all implemented as exception throws, instead of gotos. Then you could throw them deep in your AST class and still have Bison do the right thing. Then Bison could catch all other exceptions, clean up, and rethrow the non-Bison exception up t

Re: bison and C++ exceptions

2011-06-13 Thread Akim Demaille
Le 24 mai 2011 à 20:32, Sergey Klimkin a écrit : > Hi! Hi! > 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 se

Re: bison and C++ exceptions

2011-05-26 Thread Hans Aberg
[Please keep the cc to the help-bison list, so others know.] On 26 May 2011, at 13:03, John P. Hartmann wrote: > Well, I did forget, but in this case maybe we do not confuse the children. > > At one point bison picked up a bug in one of the M4 macros. It was > not easy to spot, and it took a wh

Re: bison and C++ exceptions

2011-05-26 Thread Hans Aberg
[Please keep the cc to the help-bison list, so others know.] On 26 May 2011, at 11:16, John P. Hartmann wrote: > The M4 manual by itself is of little use, as all macros are redefined. It says how to redefine them, so advanced users that need to know how it work, should consult it. It is otherw

Re: bison and C++ exceptions

2011-05-26 Thread Hans Aberg
On 26 May 2011, at 07:35, Sergey Klimkin wrote: > I guess it might be helpful, I can not claim yet : ) > there is %initial-action declaration and the %final-action may help, > but rhs symbols will not be discarded. > > %initial-action > { > try { > } > > %final-action > { >} >catch (std:

Re: bison and C++ exceptions

2011-05-25 Thread Sergey Klimkin
I guess it might be helpful, I can not claim yet : ) there is %initial-action declaration and the %final-action may help, but rhs symbols will not be discarded. %initial-action { try { } %final-action { } catch (std::exception &) { yyerror(...); YYABORT; } } into some se

Re: bison and C++ exceptions

2011-05-25 Thread Hans Aberg
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 > actio

bison and C++ exceptions

2011-05-24 Thread Sergey Klimkin
Hi! 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!? something like: yyparse_stack my_stack; try {