[antlr-interest] newbie question - mismatched input/token
Jim Idle
jimi at temporal-wave.com
Fri Jan 18 07:29:54 PST 2008
For case insensitivity, see the wiki, and:
http://www.antlr.org/pipermail/antlr-interest/2007-January/019008.html
Jim
> -----Original Message-----
> From: Gavin Lambert [mailto:antlr at mirality.co.nz]
> Sent: Friday, January 18, 2008 12:18 AM
> To: Ashish; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] newbie question - mismatched input/token
>
> At 12:15 18/01/2008, Ashish wrote:
> >I'm trying to come up with a custom select statement. However,
> >for the
> >simple grammar and input I get a mismatched-token error - see
> >details below.
> [...]
> >//Input
> >SELECT a FROM b
> >
> >//Error message:
> >recoverFromMismatchedToken
> >BR.recoverFromMismatchedToken
> >line 1:0 mismatched input 'SELECT' expecting FROM
>
> The grammar all looks fine to me. Are you sure you're choosing
> "prog" as your start rule? (Also, generally speaking, your start
> rule should have EOF at the end to make it give an error if it
> can't match the entire input.)
>
> >SELECT : 'select'|'SELECT';
> >FROM : 'from'|'FROM';
> >WHERE : 'where'|'WHERE';
>
> Note that these are insufficient for true case insensitivity. It
> won't match "Select" or "sELeCt", for example.
>
More information about the antlr-interest
mailing list