[antlr-interest] Passing user defined exceptions through the parser.
sharwell at pixelminegames.com
Tue Jan 13 08:05:34 PST 2009
There is a throwsSpec in the ANTLR tool grammar that *should* be able to
be used like this:
my_rule /*returns [Object o]*/ throws RecognitionException,
It doesn't apply to C# so it's not implemented in my CSharp3 target.
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Peter C. Chapin
Sent: Tuesday, January 13, 2009 6:13 AM
Subject: Re: [antlr-interest] Passing user defined exceptions through
Laurent Caillette wrote:
> This should work if you make OperationCanceledException a subclass of
> RecognitionException, which is a checked exception thrown by parser's
> methods. Then the catch clause does its job.
Okay, thanks. That's a little unsatisfying because the exception in
question really isn't a problem with recognition. Still, I can live with
that. I guess that's life with Java.
More information about the antlr-interest