Explain how to generate Railroad diagrams for the grammar.

This commit is contained in:
Emmanuel Briot 2022-12-15 09:29:06 +01:00
parent d625712fe1
commit 7426f191a1

View File

@ -126,3 +126,11 @@ Execute the following commands:
npm run test npm run test
``` ```
## Documentation
The grammar itself is fully described in the file grammar.js.
When it processes it, TreeSitter generates src/grammar.json, which can be
converted to a EBNF format via https://github.com/mingodad/plgh/blob/main/json2ebnf.js
and rendered into a diagram on https://www.bottlecaps.de/rr/ui if you
prefer graphical visualization (you can also copy-paste from issue #1 a
pre-processed version of grammar.json).