[antlr-interest] rethrowing of exceptions in ANTLR default exception handlers
Ric Klaren
klaren at cs.utwente.nl
Fri Mar 22 06:44:07 PST 2002
Hi,
On Thu, Mar 21, 2002 at 03:03:34PM -0700, Dennis Marsa wrote:
> An ANTLR C++ default exception handler generally looks something
> like this:
>
> catch (RecognitionException& ex) {
> if( inputState->guessing == 0 ) {
> reportError(ex);
> consume();
> consumeUntil(_tokenSet_6);
> } else {
> throw ex;
> }
> }
>
> I believe the appropriate fix is to use throw with no operand:
>
> throw; // no operand
Thanks for catching patch is in the repository now.
Cheers,
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
goes round the back and ... er ... prods it with his foot. But in a
technical way,' he added. --- From: Hogfather by Terry Pratchett.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list