-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eduardo Morras wrote:
| but don't know much about the VDBE code.

The opcodes and operation (stacks etc) are all well documented:

~ http://www.sqlite.org/opcode.html

All the necessary opcodes are already present in that you can do checks
(ge, eq, le etc), conditionals (if) and program flow (goto, gosub, return).

A simple sanity check of your idea is to have some PL/SQL (or whatever
language of your choice) and hand compile it into VDBE.  You'll soon get
a feel for whether the existing opcodes work well, or if you will need
something completely different.  Going from hand compilation to machine
compilation is then a simple matter of programming :-)

If you are unfamiliar with how to write a compiler then almost any
textbook out there will do.  They usually have a first section going to
extraordinary length on grammars, automata, parsing and lexing etc.  The
good news is you can just use Lemon which is another fine drh product
and used for the SQL grammar in SQLite.  Pretty much every book and
tutorial then shows how to emit code for a simple stack machine.
Luckily enough, that is exactly what vdbe is.  Later chapters will be on
generating error messages, optimizations, and dealing with the fun low
level things in modern CPUs, all of which you can ignore.

There is even a starting grammar for you:

~  http://www.antlr.org/grammar/1107752678378/PLSQLGrammar.g

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFjj0GmOOfHg372QQRAiAaAJwINxMkhdyUFKKu/fT3HGkEcjquOACeO06x
WY7L3Zhh8h2YbU60oMzNC1Q=
=qKyu
-----END PGP SIGNATURE-----

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to