[antlr-interest] SQL grammar, keywords that can be
identifiers
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Jul 23 10:21:33 PDT 2004
On 7/23/04 5:40 PM, "Monty Zukowski" <monty at codetransform.com> wrote:
> On Jul 23, 2004, at 3:50 AM, Ruslan Zasukhin wrote:
>
>> But in general problem is complex.
>> By SQL92 standard
>>
>> ANY KEYWORD can be used as name of table or field or function.
>>
>> It looks your adivce can resolve only that 2 examples which I have
>> show.
>> But geenral task is more hard.
>>
>> Any ideas now ?
>
> Read through my parser filter example.
> http://www.codetransform.com/filterexample.html If you can recognize
> the syntax for a table name, field or function generically then you
> could have a filter that changed the tokens back into identifiers. For
> instance if you see a keyword followed by a left paren then you know it
> is a function, so make it an identifier.
Thank you, Monty.
We have here the next idea that we want to try at first.
It looks we may correct just 3 rules of grammar
column_ref
table_ref
function
Using something as next
Function
: ID LPARENT => so we have normal function
| . LPARENT => we have function with name == keyworrd,
so as Pete suggests {##.setType(FUNC);};
The same for column and table names.
IT seems should work.
We will try later.
--
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 go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list