[antlr-interest] Re: Again Infinite recursion on SQL
table_ref <-> join_table
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Sep 4 11:49:18 PDT 2002
on 9/4/02 21:01, Sinan at sinan.karasu at boeing.com wrote:
>> 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
>> ;
>>
>
> yacc would resolve this with precedence rules. So
> what is needed is the determination of the meaning
>
> a join b join c.
> is it left associative? right assoc? or non.
>
> I suspect it is non, so
>
> joined_table
> : table_reference ("join"^ joined_table)?
> ;
>
> table_reference
> : table_name // IDENT
> | subquery // '(' query ')'
> ;
>
>
> is probably the right approach. So
>
> a join b join c
>
> would become
> join
> |
> a--join
> |
> b--c
Okay, I see idea. But what you suggest if JOIN should be left associative?
In fact it must be left associative...
> Sinan (who likes tail recursion...)
Now I know whom I will bother!!! :-)
--
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