[antlr-interest] exceptions in the lexer
Harald Mueller
harald.m.mueller at bigfoot.com
Tue Dec 7 01:48:05 PST 2004
>
> Hey, Just extend you user-defined exceptions from RuntimeException and
> throw
> them.
He explicitly didn't want to do this - but I also do it (using a
WrappingRuntimeException which I need at other places anyway (e.g. for the
Runnable.run() method)).
> You catch all your RuntimeExceptions don't you?
> Remember OutOfMemoryException is not necessarly fatal.
This is not an Exception, but an Error - you would never catch this.
Regards
Harald M. Müller
> 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
>
>
>
>
>
>
>
--
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!
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