[antlr-interest] Help on /*empty command*/ ; ; ; ;
sunshine at public.kherson.ua
Fri Jul 11 21:54:13 PDT 2008
On 7/12/08 12:37 AM, "Chris Rebert" <cvrebert at gmail.com> wrote:
> I'm a newbie, but i think the possible lookahead through sql_statement
> might be the problem.
> Have you tried:
> : sql_statement? SEMI
Not yet, and I think this will bring performance troubles.
I know that such empty commands are allowed e.g. In C++.
I have take C++ grammars, and later realize why in SQL I have problems.
* because in C++ SEMI must present.
* but in SQL it MAY present.
So in SQL I need something as
| statement (SEMI)?
But this not works also...
I think because ANTLR cannot differ when add SEMI to second branch, and when
it is really just SEMI.
> Best of luck,
> On Fri, Jul 11, 2008 at 4:58 AM, Ruslan Zasukhin
> <sunshine at public.kherson.ua> wrote:
>> Hi All,
>> I try implement on ANTLR 2.7 the empty command for SQL.
>> So parser will eat something as
>> CREATE TABLE T(f1 int);
>> Can somebody show quick draft of such rule?
>> This my attempt not works as expected.
>> : (sql_single)* EOF
>> : sql_staement (SEMI)?
>> | SEMI
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
[I feel the need: the need for speed]
More information about the antlr-interest