[antlr-interest] exceptions in the lexer

matthew ford Matthew.Ford at forward.com.au
Tue Dec 7 00:30:08 PST 2004


Hey, Just extend you user-defined exceptions from RuntimeException and throw
them.
You catch all your RuntimeExceptions don't you?
Remember OutOfMemoryException is not necessarly fatal.
matthew
----- Original Message ----- 
From: "Paul J. Lucas" <pauljlucas at mac.com>
To: <antlr-interest at yahoogroups.com>
Sent: Tuesday, December 07, 2004 11:10 AM
Subject: Re: [antlr-interest] exceptions in the lexer


>
> On Mon, 6 Dec 2004, Terence Parr wrote:
>
> > Are you familiar with the filter option on the lexer grammar?
>
> Yes in the sense that I've read that bit of the documentation,
> but I've never used it.
>
> I don't want my entire lexer to be a filter since I need it to
> be a real lexer for a parser.
>
> My particular case at hand is dealing with pragmas that can
> appear anywhere comments can.  Since comments are most easily
> handled in the lexer, I handle pragmas there to for the same
> reason.  The problem is what to do if there's an error in a
> pragma.  The lexer can't throw user-defined exceptions.  (I
> might be able to work around it by hiding the real exception
> inside a Runtime exception, but that's ugly.
>
> - Paul
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
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