[antlr-interest] Help on /*empty command*/ ; ; ; ;

Chris Rebert cvrebert at gmail.com
Fri Jul 11 14:37:32 PDT 2008


I'm a newbie, but i think the possible lookahead through sql_statement
might be the problem.
Have you tried:

sql_single
   : sql_statement? SEMI
   ;


Best of luck,
Chris

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
>    :  (sql_single)*  EOF
>    ;
>
> sql_single
>    : sql_staement  (SEMI)?
>    | SEMI
>
>
>
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
>
>


More information about the antlr-interest mailing list