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

Terence Parr parrt at cs.usfca.edu
Thu Oct 12 12:40:40 PDT 2006


On Oct 12, 2006, at 12:12 PM, Robert Hill wrote:

> 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!)


Weird.  If you have a rule that doesn't match anything like:

a : ;

  if so, adding a try catch the generated air because it cannot throw  
the exception.

Ter


More information about the antlr-interest mailing list