Subject | Re: [ib-support] Re: -- Comment |
---|---|
Author | Mark O'Donohue |
Post date | 2001-11-16T08:28:02Z |
Claudio Valderrama C. wrote:
Claudio complaining that '--' comments didn't work - he explained the
error of my ways to me :-). I got a bit further into it then putting
in readline.
The current isql parser is real basic, like check to see
if firstword('select' || update || insert) then
=> sql stmt, (and read till get a ; ) with some basic stuff to skip
strings and comments.
throw lot to dsql to parse sql stmt.
elsif firstword('set' )
=> cmd
elsif firstword('read')
etc....
endif
It doesn't have any trendy form, or layered approach that stripped
comments before parsing and is a bit of a hack, one of those usual
things that grow over time into something larger and more complex than
they should be.
It would take about a day to replace the current parser in isql, and
it's a fairly trivial exercise (simple examples abound on the web and in
any intro to compilers course), it should be done in fb2 so it use c++
strings toeasily handle input of any length (current max in fb1 is 2048
or something).
What Claudio says, is as usual the definative word on the issue
BTW: I like language parsers like bison/yacc but this problem is more in
the realm of lex/flex
Cheers
Mark
--
Your database needs YOU!
http://www.firebirdSQL.org
>I got into this when I put readline into fb2, and I think I even emailed
>or
>-- comment ;
>it takes the whole line and sends it to the engine. Mark's opinion is that
>isql should be cleverer.
>
Claudio complaining that '--' comments didn't work - he explained the
error of my ways to me :-). I got a bit further into it then putting
in readline.
The current isql parser is real basic, like check to see
if firstword('select' || update || insert) then
=> sql stmt, (and read till get a ; ) with some basic stuff to skip
strings and comments.
throw lot to dsql to parse sql stmt.
elsif firstword('set' )
=> cmd
elsif firstword('read')
etc....
endif
It doesn't have any trendy form, or layered approach that stripped
comments before parsing and is a bit of a hack, one of those usual
things that grow over time into something larger and more complex than
they should be.
It would take about a day to replace the current parser in isql, and
it's a fairly trivial exercise (simple examples abound on the web and in
any intro to compilers course), it should be done in fb2 so it use c++
strings toeasily handle input of any length (current max in fb1 is 2048
or something).
What Claudio says, is as usual the definative word on the issue
BTW: I like language parsers like bison/yacc but this problem is more in
the realm of lex/flex
Cheers
Mark
--
Your database needs YOU!
http://www.firebirdSQL.org