[antlr-interest] exceptions in the lexer
Paul J. Lucas
pauljlucas at mac.com
Mon Dec 6 16:10:01 PST 2004
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
<*> 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