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: ~[] >
}

-Lex



>From: Brian Goetz <[EMAIL PROTECTED]>
>Reply-To: "Lucene Users List" <[EMAIL PROTECTED]>
>To: Lucene Users List <[EMAIL PROTECTED]>
>Subject: Re: AW: Lexical Error
>Date: Fri, 7 Dec 2001 12:44:09 -0800
>
> > >Is there a good reason, why the QueryParser should throw an Error 
>instead of
> > >an Exception?
> > >
> > Unfortunatly this is the feature of JavaCC and not only of Lucene's
> > QueryParser.
>
>Sort of.  It should be possible to fix this by using a different approach
>to token building.
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to