[antlr-interest] Re: simple exception question

Monty Zukowski monty at codetransform.com
Wed Jun 23 09:23:29 PDT 2004


Greg,
	Turn off default error handling with the grammar level option (see 
docs on options).  Then ANTLR's default mechanism which catches and 
eats the exception will be disabled and it will pop up all the way 
through to your exception handler.

Monty

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html


---------------
Currently in my grammar I'd like to have any exceptions thrown to a top
level class in order to handle any languages I pass through that don't 
match
my productions.  I implemented a solution but I'm not happy with it.  
I'm
currently appending:
     exception // for rule
     catch [RecognitionException ex] {
        throw ex; // we want this to be handled at the application level
     }

after each production.  My top level class can receive any exceptions 
and
take appropriate action.  My question is, is there a simpler way to do 
this?
   Maybe some switch I'm not aware of that will automatically throw any
exceptions to a top level class?   Thanks.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list