in reply to In search of an efficient query abstractor
If you decided to allow C, you could even start from the mysql source itself and derive a fingerprinter from the actual parser (from sql/sql_yacc.yy, it looks like the parsing is done with yacc/bison).