Re: Re: Writing a parser

From: Date: Tue, 09 Jul 2002 09:37:28 +0000
Subject: Re: Re: Writing a parser
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7584@lists.php.net to get a copy of this message
On Tue, 09 Jul 2002 11:37:23 +0200 Ulf Wendel <wendel@e-commerceit.de> wrote: > Manuel Lemos wrote: > > > Hello, > > > > On 07/08/2002 01:20 PM, Brent Cook wrote: > > > >> Dear Folks, > >> > >> I'm writing a SQL parser for DB_DBA. I've worked up a prototype, but > >> have > >> not a lot of experience with writing parsers, so I have attached a > >> sample > >> that understands 'create' and generates an assoc array of what it finds. > >> Could the wiser among you please share some feedback re. the general > >> structure and design of a parser? Right now, it's basically a finite > >> state > >> machine that operates on tokens from a sql string one-by-one. > > > > > > Mind me for asking but this idea does not seem to make much sense to me. > > > SQL parsers become very handy in cases you want to: > > - compile standard SQL into non-standard SQL > - compile SQL into other query languages > - automatically modify a SQL statement > > I'd like to see a SQL parser (SQL-99?) in PEAR. This would enable me to > replace some hacks I used to expand SQL queries automatically. > > Ulf Can be very hard to create an efficiant parser. Limit it to the ANSI 99 can simplify the job, and can make useless with pear::db. Which kind of queries expand do you need ? pa ps : Did you ever received my mails about ooh ???????????????????????????????????????????????????????????????????? damned!

« previous php.pear.dev (#7584) next »