[antlr-interest] Again Infinite recursion on SQL table_ref <-> join_table

Bogdan Mitu bogdan_mt at yahoo.com
Fri Aug 30 05:36:19 PDT 2002


--- Ruslan Zasukhin <sunshine at public.kherson.ua> wrote:
> Hi Terrence,
> Hi Sinan,
> Hi Alan,
> Hi All,
> 
> Before ask on list I have search list archive, and found that with the
> same
> problem have meet before Sinan and Alan. I have not found solution on
> list,
> so I CC to you guys, may be you already have resolve this problem in your
> SQL grammar?
> 
> For all, I will show here where problem happens.
> In Standard SQL 92 we have the next rules. I have simplify them to extract
> only important part here:
> 
> joined_table
>     :    table_reference "join" table_reference
>     ;
> 
> 
> table_reference
>     :    table_name             // IDENT
>     |    subquery               // '(' query ')'
>     |    joined_table
>     ;
> 
> This 2 rules give this error: infinite recursion.
> 
> Anybody know how this can be resolved ?

I don't know much about SQL, but try this:

primitive_element
    :    table_name             // IDENT
    |    subquery               // '(' query ')'
    ;

table_reference
    :    primitive_element ( "join" primitive_element )*
    ;

Regards,
Bogdan

> ---
> Terrence, if you have time, please look on this.
> I promise that I will submit my resulted 92 SQL grammar to your for your
> collection. It is much fuller than current SQL.g or OracleSql.g
> 
> 
> -- 
> Best regards,
> Ruslan Zasukhin      [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at paradigmasoft.com
> web: http://www.paradigmasoft.com
> 
> To subscribe to the Valentina mail list
> send a letter to valentina-on at lists.macserve.net
> -------------------------------------------------------------
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list