[antlr-interest] V3.0 error handling..

Robert Hill rob.hill at blueyonder.co.uk
Thu Oct 12 12:12:08 PDT 2006


Ok I've tried adding this, but I get lots of errors saying that my exception
is never thrown in the corresponding try statements.
I looked at the Mantra grammars as to where to put the rulecatch statement ,
so I placed it at the top of my grammar...
If I place it below the @init section of the rule that throws, the error is
that the exception must be caught or declared.

I want 1 rule to throw an exception, how/where do I place the @rulecatch?
(any pointers in the wiki would be good too!)

Cheers
Rob



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Terence Parr
> Sent: 09 October 2006 03:02
> To: ANTLR Interest
> Subject: Re: [antlr-interest] V3.0 error handling..
> 
> use action @rulecatch {...} and say catch(RecognitionException e)
> { throw e; }.  Or that should work ;)
> Ter
> On Oct 8, 2006, at 12:39 PM, Robert Hill wrote:
> 
> > Hi all :)
> >
> > I want to bomb out of a rule immediately on a fatal condition how
> > do I do it
> > gracefully in V3? (java code..)
> >
> > Cheers!
> >
> > Rob
> >
> >
> >
> >





More information about the antlr-interest mailing list