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

Re: Extra code in y.tab.h

2011-05-25 Thread Hans Aberg
On 23 May 2011, at 09:40, Panayiotis Karabassis wrote: > What is the recommended way to get extra declarations in y.tab.h (in my > case Parser.h) for a C++ parser? Have you checked the Bison manual, sec. 10.1.6 A Complete C++ Example? One can put it into a new header and include the header. Ha