sqlite-parser
sqlite-parser copied to clipboard
Do you have the AST definition document?
I'm learning this project and I want a document about how AST defined just like https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
Hey @lunexnocty
I don't think there is any documentation like this. There are still a few options though:
- I've a project that generated SQL from the AST output by sqlite-parser. The code is quite good as an example of using the AST. It should cover all paths (I haven't run it with a current version of the library but the AST has been fairly stable). You can take a look here: https://github.com/jdrew1303/sqlgenerate/blob/master/sqlgenerate.js
- You can look through the test folder. There are examples of the SQL and the json ast generated by this library. It's been the main guide I've used while working with the library.
- You can use
GrammKitto generate railroad diagrams of the language. You might need to preprocess the peg file before using this.pegjs-stripmight be of some help with this.
Hope this helps 👍 👋