Re: Writing a parser
| From: | Manuel Lemos | Date: | Tue, 09 Jul 2002 03:56:34 +0000 |
| Subject: | Re: Writing a parser | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7578@lists.php.net to get a copy of this message | ||
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. Maybe you haven't thought of that but most SQL DBMS as just that, a SQL parser with a query engine that executes queries on database files like that. So my question what would be the advantage of using a slow SQL wrapper that you intend to do in PHP, over using a real SQL DBMS like MySQL, PostgreSQL, Oracle, etc..? It seems to me that your SQL wrapper would be too slow to be useful, don't you think? -- Regards, Manuel Lemos