|
|
|
|
|
by zellyn
69 days ago
|
|
Does SQLite not have a lemon parser generated for its SQL? When I ported pikchr (also from the SQLite project) to Go, I first ported lemon, then the grammar, then supporting code. I always meant to do the same for its SQL parser, but pikchr grammar is orders of magnitude simpler. |
|
The problem comes from how SQLite's upstream parse.y works. Becuase it doesn't actually generate the parse tree, instead generating the bytecode directly, the intepretation of any node labelled "id" or "nm" is buried inside the source code behind many layers of functions. You can see for yourself by looking at SQLite's parse.y [2]
[1] https://github.com/LalitMaganti/syntaqlite/tree/main/syntaql... [2] https://sqlite.org/src/file?name=src/parse.y&ci=trunk