Hi Jon,
What I was thinking of when I wrote this? I had a 3rd year course at
university that taught compiler construction, where we used a book by N.
Wirth to do source code parsers. So much for the stuff they teach you at
varsity :-(
At the moment I only have support for CREATE TABLE clauses. The main
advantage of this parser (as opposed to yours :-) is that it deals better
with whitespace like newlines (or lack of them). For example:
CREATE TABLE
(
colname int
)
and
CREATE TABLE ( coname int )
should both give the same result. That's probably where the advantages end
:-)
I'll try and make time to improve on the design.
~ Leon
p.s. Isn't this your itch? :-)
----- Original Message -----
From: "Jon Stevens" <[EMAIL PROTECTED]>
To: "Turbine" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 2:16 AM
Subject: SQLToAppData.java
> Hey Leon,
>
> How do I say this nicely: the SQL parser is..uhh...lacking? <smile> :-)
>
> It should be able to parse something like this (see below), but it fails
> miserably. Looking at the code leads me to believe that it is
fundamentally
> badly designed from the point of view that it makes it very difficult to
> deal with stuff in the file that it does not know about. Given that most
> .sql files will look like something below, it would be nice to have the
> parser actually work on it without having to munge it into something that
> the parser can read.
>
> Can you comment a little more on what you were thinking when you wrote
this
> class? I know that my previous efforts in this area were very specific to
> MySQL, but at least it worked.
>
> -jon
>
>
> # HELM_VC_MAP maps the repository directory to the working directory with
a
> # list of files.
> #
> # 100,000s of entries.
> #
> drop table if exists HELM_VC_MAP;
> create table HELM_VC_MAP (
> MAP_ID integer AUTO_INCREMENT NOT NULL,
> VIEW_ID integer NOT NULL,
> REPOSITORY_DIR text NOT NULL,
> WORKING_DIR text,
> FILE_LIST text,
> PRIMARY KEY (MAP_ID),
> FOREIGN KEY (VIEW_ID) REFERENCES HELM_VC_VIEW (VIEW_ID)
> );
> create index VIEW_ID on HELM_VC_MAP (VIEW_ID);
>
>
> --
> Honk if you love peace and quiet.
>
>
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]