Re: Re: Writing a parser
| From: | Ulf Wendel | Date: | Tue, 09 Jul 2002 09:37:23 +0000 |
| Subject: | Re: Re: Writing a parser | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7582@lists.php.net to get a copy of this message | ||
Manuel Lemos wrote:
Hello, On 07/08/2002 01:20 PM, Brent Cook wrote: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. UlfDear 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.