lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Goetz <br...@quiotix.com>
Subject Re: AW: Lexical Error
Date Mon, 10 Dec 2001 09:14:35 GMT
> Perhaps something as simple as adding a catch-all token.  When the parser 
> encounters something goofy, it will match the last token (and not throw an 
> Error), but since it isn't expecting a <CATCHALL> token,
> you'll get a nice ParseException.
> 
> <*> TOKEN : {
>   < WHATEVER_TOKEN_DEFS_YOU_WANT: "blah" > |
>   < CATCHALL: ~[] >
> }

Yes, this is the standard JavaCC trick for preventing the
TokenMgrError from being thrown, and it works just fine (then the
error becomes a ParseException which can be caught.)

However, I'd prefer to just fix the damn thing.  

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message