Posted By:
Charles_Lee
Posted On:
Friday, February 6, 2009 09:14 AM
Hi All, I am a newbie to Antlr, just as our existing application used a bit of it, I have to fix a bug in it. e.g. the tokens section defined as below, tokens { SELECT="SELECT"; FROM="FROM"; WHERE="WHERE"; EQUAL="EQUAL"; } selectStatement return [] { } : SELECT[] : FROM [] : WHERE [] : EQUAL[] ; If I input a statement like SELECT c1 FROM tab1 WHERE c1='SELECT', Antlr always gives an error 'Mismatched token'. Finally I found it was because of 'SELECT' is a keyword. is there any way to skip over the token check for literal strings? Thanks in advance.
More>>
Hi All,
I am a newbie to Antlr, just as our existing application used a bit of it, I have to fix a bug in it.
e.g. the tokens section defined as below,
tokens {
SELECT="SELECT"; FROM="FROM"; WHERE="WHERE"; EQUAL="EQUAL";
}
selectStatement
return []
{
}
: SELECT[]
: FROM []
: WHERE []
: EQUAL[]
;
If I input a statement like SELECT c1 FROM tab1 WHERE c1='SELECT', Antlr always gives an error 'Mismatched token'. Finally I found it was because of 'SELECT' is a keyword. is there any way to skip over the token check for literal strings?
Thanks in advance.
<<Less