Ok, I read the generated parser cpp file and it looks like I must have all the try/catch blocks inside my rule actions. It doesn't look like the parser destructor will clean things up properly.
So I would like to turn this thread into a feature request thread. It would be very nice if there were a yyerror() exception class and a yyabort() exception class. Throwing yyerror()/yyabort() exceptions would be equivalent to the YYERROR/YYABORT macros but they can occur anywhere, not just in the action. It would be a simple matter to wrap the yyreduce switch statement in a try/catch block to catch these exceptions and execute the YYERROR or YYABORT macros. The error() method could also be called using a location and an error message contained in the yyerror()/yyabort() object. I guess there would need to be a new bison declaration for turning on the try/catch block in the C++ skeleton. Otherwise everyone would be compelled to compile with exception support turned on. What's the process for new feature requests? Should I create a patch and upload it to savannah? -- john _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison