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 to the parser-caller.
-- john On Jun 13, 2011, at 11:19 AM, Akim Demaille wrote: > > 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 semantic >> action!? > > This was not considered when writing the C++ parser skeleton :( Parsing is > expected to be interrupted with YYERROR or YYABORT/YYACCEPT. So if there are > not too many actions that need to be wrapped, then maybe you can catch the > exception, save it, YYABORT, and rethrow from the parser-caller? > > Your request is legitimate, this is something we should address. > _______________________________________________ > help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison