You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Steve Morin <st...@gmail.com> on 2007/04/06 03:42:18 UTC

Database implementation help

I am looking to implement a sql parser, I have been looking for a book
or paper on the subject with little to no luck.  Can any one point me
in the right direction or suggest a book on the subject?  I would
appreciate any pointers to resources on the subject.
Steve

Re: Database implementation help

Posted by Steve Morin <st...@gmail.com>.
Thanks for the help
Steve

On 4/10/07, Dag H. Wanvik <Da...@sun.com> wrote:
> Dyre.Tjeldvoll@Sun.COM writes:
>
> > As for paper/book. I guess that if you order a copy of the SQL
> > standard (with complete grammar) from ISO (www.iso.org) and get the manual
> > for JavaCC you should have pretty much what you need. At least to get
> > started...
> >
> > Wild idea: Maybe you could write a script which converts the grammar
> > decription in the standard into a JavaCC grammar representation?
>
> A caveat: typically, a descriptive grammar needs to be tweaked (often
> a lot) to be useful as an input to parser generators, though, due to
> grammar class restrictions. JavaCC is of type LL(k),
> cf. http://en.wikipedia.org/wiki/Category:Parsing_algorithms
>
> How far the ISO SQL grammar is from being LL(k) "out of the box", I
> don't know.
>
> Thanks,
> Dag
>

Re: Database implementation help

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Dyre.Tjeldvoll@Sun.COM writes:

> As for paper/book. I guess that if you order a copy of the SQL
> standard (with complete grammar) from ISO (www.iso.org) and get the manual
> for JavaCC you should have pretty much what you need. At least to get
> started... 
>
> Wild idea: Maybe you could write a script which converts the grammar
> decription in the standard into a JavaCC grammar representation?

A caveat: typically, a descriptive grammar needs to be tweaked (often
a lot) to be useful as an input to parser generators, though, due to
grammar class restrictions. JavaCC is of type LL(k),
cf. http://en.wikipedia.org/wiki/Category:Parsing_algorithms

How far the ISO SQL grammar is from being LL(k) "out of the box", I
don't know.

Thanks,
Dag

Re: Database implementation help

Posted by Dy...@Sun.COM.
Steve Morin <st...@gmail.com> writes:

> I am looking to implement a sql parser, I have been looking for a book
> or paper on the subject with little to no luck.  Can any one point me
> in the right direction or suggest a book on the subject?  I would
> appreciate any pointers to resources on the subject.

Using Google to search for "sql parser library java" 

I found

http://www.experlog.com/gibello/zql/

Seems they are using JavaCC like Derby is doing. But since it is a
separate library it might be easier to play with...

(Disclaimer: I haven't tried zql myself, and the license seems
unclear to say the least...)

As for paper/book. I guess that if you order a copy of the SQL
standard (with complete grammar) from ISO (www.iso.org) and get the manual
for JavaCC you should have pretty much what you need. At least to get
started... 

Wild idea: Maybe you could write a script which converts the grammar
decription in the standard into a JavaCC grammar representation?
 
-- 
dt