cube2222 / octosql

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Mozilla Public License 2.0
4.92k stars 204 forks source link

Grammar railroad diagram #283

Open mingodad opened 2 years ago

mingodad commented 2 years ago

Using this tool https://www.bottlecaps.de/convert/ we can have a nice navigable railroad diagram (Syntax diagram) for sql.y.

Copy and paste sql.y on https://www.bottlecaps.de/convert/ Input grammar: textarea and then click the Convert button (with EBNF as target format) then click the View Diagram button to view a nice navigable railroad diagram.

mingodad commented 1 year ago

I've just added this project grammar to https://mingodad.github.io/parsertl-playground/playground/ (select OctoSQL parser (partially working) under examples then click Parse to see the parser tree for the content of Input source editor).

The main repository is here https://github.com/mingodad/parsertl-playground it's a Yacc/Lex runtime grammar evaluator that can provide quick feedback loop when developing/testing/debug grammars.

It can also generate EBNF compatible with https://www.bottlecaps.de/rr/ui to generate railroad diagrams.

I hope it can help develop/debug/extend/test/document the grammar used in this project.

Any feedback is welcome !