[antlr-interest] Re: exceptions in the lexer
Terence Parr
parrt at cs.usfca.edu
Fri Dec 10 14:50:07 PST 2004
On Dec 10, 2004, at 2:25 PM, Paul J. Lucas wrote:
> On Fri, 10 Dec 2004, Terence Parr wrote:
>
>> Hm...perhaps I should just make it catch ANTLRException, the root,
>> instead?
>
> That would work also (and should fix the problem once and for
> all).
Oh, I think I remember now. Definitely had to do with
TokenRetryException. I wanted to be able to blast out of the lexer
entirely on an exception to force the a token stream switch to flip to
another lexer and retry. If I made that part of the same hierarchy
under RecognitionException then you couldn't do the retry. I
specifically made it separate. Hmm...seems like we need it.
From the comment on the interface, "Anything that goes wrong while
generating a stream of tokens", I think I meant to be different than
recognition issues. For the life of me though, I can't remember
expecting lexer *recognition* exceptions to make it to the parser.
Yet, that is what the code says. Bizarre. The lexer should just look
for another token.
Ok, i'll look into it.
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
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