[comp.databases] SQL grammar

james@sparrmsuucp (James Buchanan) (05/25/89)

I few months ago I saw a request for a (YACC?) SQL grammar go by.
Is there such a thing? Can SQL be specified in yacc's LALR? 

If this grammer surfaced I would be very grateful if someone could
mail it to me or post it.

Thanks.


    James Buchanan				james@sparrms.UUCP
    Spar Aerospace Ltd		
    1700 Ormont Drive			(416) 745-9680
    Weston, Ontario, CANADA  M9L 2W7

lcain@cuc1.UUCP (Leroy Cain) (05/29/89)

In article <231@sparrmsuucp>, james@sparrmsuucp (James Buchanan) writes:
> I few months ago I saw a request for a (YACC?) SQL grammar go by.
> Is there such a thing? Can SQL be specified in yacc's LALR? 
> 
> If this grammer surfaced I would be very grateful if someone could
> mail it to me or post it.
> 
> Thanks.
> 
> 
>     James Buchanan				james@sparrms.UUCP
>     Spar Aerospace Ltd		
>     1700 Ormont Drive			(416) 745-9680
>     Weston, Ontario, CANADA  M9L 2W7

Last summer I posted a SQL written in YACC.  I have been working off
and on mainly off on an ANSI version of SQL.  Unfortunatly I have
to make some money to live on so it is taking longer than expected.
I will try to get the ANSI SQL done in a month or two in the mean
time if anyone wants the old version let me know.


MS-DOS Just say NO!!!!!			      OS/2 Why????
Leroy Cain;      Columbia Union College;      Mathematical Sciences Department
7600 Flower Ave. WH406;  	              Takoma Park, Md 20912
(301) 891-4172				      uunet!cucstud!lcain

hughes@math.Berkeley.EDU (Eric Hughes) (05/30/89)

In article <231@sparrmsuucp>, james@sparrmsuucp (James Buchanan) writes:
>I few months ago I saw a request for a (YACC?) SQL grammar go by.
>Is there such a thing? Can SQL be specified in yacc's LALR? 

I found this reference in the library the other day.  It looks 
promising, but I have not yet looked it up.

Heerjee, Kaizad B. and Sadegi, Rubik
Rapid implementation of SQL: a case study using YACC and LEX
Information and Software Technology 30: 228-236 May 1988

Eric Hughes
hughes@math.berkeley.edu   ucbvax!math!hughes

andreas@nsebln.UUCP (06/07/89)

You've written about the new SQL-standard SQL'89. May you give me the
adress of ANSI that I can order the description of new SQL standard ?

A. Elsholtz

djds@goanna.cs.rmit.oz.au (DARYL JOHN D'SOUZA) (05/30/91)

Has anyone got a SQL grammar definition suitable for yacc?  It is for
a student project, so it doesn't need to be the complete grammar.
Indeed, a simplified version would even be better.

I need it for a possible student project which will get students to
write a simple query optimiser.  If I go ahead with it and it proves
to be a success I am happy to relay my experiences to interested 
parties.  Indeed, any bright ideas are most welcome particularly
if they address academic objectives!

Daryl D'Souza
-- 
Dept. of Computer Science, RMIT, GPO Box 2476V Melbourne 3001, Australia. 
email: djds@goanna.cs.rmit.oz.au. Tel: +61 3 660 2927/2348; Fax: +61 3 662 1617.

njacobs@kong.gsfc.nasa.gov (Nick Jacobs - EOS) (05/31/91)

In article <6040@goanna.cs.rmit.oz.au> djds@goanna.cs.rmit.oz.au (DARYL JOHN D'SOUZA) writes:
>Has anyone got a SQL grammar definition suitable for yacc?  It is for
    [ ... ]
>Daryl D'Souza

Actually, you can pretty much feed the definitions in the ANSI standard
straight into yacc. The notation changes are mostly so trivial you
can apply them as you're typing it in, e.g.
<where clause> ::= WHERE <search condition>  -- ANSI X3.135-1989

becomes

where_clause   | WHERE search_condition
               ;                             -- yacc

You need to add a grammar rule for each list, and rules for
option keywords, all straightforward. I recently built a parser
for SQL query specifications using yacc, email me if you want
more details.

Nick Jacobs