From 7426f191a16a7fc5d988486812f314a94cbfdaf3 Mon Sep 17 00:00:00 2001 From: Emmanuel Briot Date: Thu, 15 Dec 2022 09:29:06 +0100 Subject: [PATCH] Explain how to generate Railroad diagrams for the grammar. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 9cf6b0a..8fd7a48 100644 --- a/README.md +++ b/README.md @@ -126,3 +126,11 @@ Execute the following commands: 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).