Re: [gnome-db] refactoring completed
- From: Andrew Hill <andru treshna com>
- To: Gonzalo Paniagua Javier <gonzalo gnome-db org>
- Cc: GDA <gnome-db-list gnome org>
- Subject: Re: [gnome-db] refactoring completed
- Date: Mon, 29 Apr 2002 23:11:25 +1200
Gonzalo Paniagua Javier wrote:
* [ Rodrigo Moya <rodrigo gnome-db org>
* Sun, 28 Apr 2002 13:44:06 +0200 ]
hmm, Gonzalo started some work on a bison/lex-based parser, but he
stopped because it causes many problems, specially that as soon as a
syntax error is found, the whole parsing process stops, which may not
fit our needs.
Well, I started the bison lex parser for SQL99, but I'm sure it's
easier to add support for new stuff since SQL92 to the one that
Andrew already has.
How far did you get along with your code?. Is building a structure in memory
of the sql statement and understanding keywords etc adquate/useful?
The final structure will contain a lot of GLists.
So Gonzalo was thinking on using a GScanner-based parser, which will
allow us to know exactly where the syntax error is, thus being more
powerful for our needs.
Well, the flex/bison parser can tell where the error is and we
can send a error to the caller. Also, if XQL does not check the
syntax of the query, this check can be done converting it to
SQL.
The question is: do we want to be able to report an SQL syntax
error before sending the query to the backend?
* yes: then we need a bison/flex parser. As I said
above, we can start using Andrew's and complete it to
support SQL99.
* no: we can do it with a lexer and some glue.
Do you want a seperate library for it? at the moment its a seperate module
in my code but still in the makefile.
i normally use
module_file_functionname(...);
GLib variable names are used.
Oh and someone else (Jean-Michel) asked about database specific sql
commands.
Yeah I find at the moment using custom functions etc also chocks the SQL
parser
so i jsut told my code to try anyway at the query if it fails the sql
parser. Cuase
it often did on those nasty sql statements. And mark it that this sql
isn't supported
by the parser.
Anyway I'll be writing hte code over next 3 weeks, to get it up to
scratch. I only
SQL92 but if your familiar with lex your welcome to add in more.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]