-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 BareFeet wrote: > Is there any way to parse a create statement (eg create table, create view, > create trigger) into its components?
One simple way is to use an authoriser while calling sqlite3_prepare. You'll find every action that is done by the statement. > Since SQLite does this internally using the Lemon parser, surely there's a > simple way to get the parser results? As with many other parsers, a parse tree is not built. Instead on recognition of parts various internal functions are called to build up operation codes for the virtual machine (Google "SQLite VDBE" to find out more). Consequently the parser results are a virtual machine program. In neither case (VDBE program or authoriser) will you be able to tie which portion of the query string is tied to which actions. The only way you could do this is to copy the SQLite grammar and write your own functions on rule recognition. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktXO1sACgkQmOOfHg372QRvGwCgt/OxqODNedvNz5LB7NCBntI0 PngAoJ8fNoATaJn/adPTplc6q0IeLs5b =2d5g -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users