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

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Aug 30 06:23:35 PDT 2002


on 8/30/02 15:36, Bogdan Mitu at bogdan_mt at yahoo.com wrote:

>> 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 )*
>   ;

Or in other words:

joined_table
    :    table_reference ("join" table_reference)*
    ;

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

Wow, it looks this must work.
Thank you very much, Bogdan!  :-)



-- 
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/ 



More information about the antlr-interest mailing list