Closed mingodad closed 1 year ago
Are you suggesting we include a railroad diagram as part of the documentation? that would certainly be neat. I am currently using pandoc
to generate the docs, so that would mean the grammar would be a piece of include html that doesn't get automatically updated, which is less than ideal..
An automatically derived parser is likely more challenging given all the special parsing around indents.
First, the above EBNF is not a correct translation of my use of ...
. Something of the form r = a ... b
in EBNF would have to be written r ::= a (b r)?
, which forces the use of an extra rule r
, which I always found annoying. Also, the ?
is easy to miss and always at the end, I like []
much better.
[ a b ... ]
would become (a b)*
, you made it into (a b "...")?
The use of ||
would have to be factored out, it is incorrect in the EBNF.
You don't use '
or "
consistently.
That said, there may be some value using a standard notation :)
Seems like so far we are still maintaining the grammar in markdown..
Looking at https://aardappel.github.io/lobster/language_reference.html if the grammar is described with an
EBNF
understood by https://www.bottlecaps.de/rr/ui we could have a nice navigable railroad diagram (and maybe even an alternative parser with https://www.bottlecaps.de/rex/ ).Copy and paste the
EBNF
(manually incomplete translated) shown bellow on https://www.bottlecaps.de/rr/ui on the tabEdit Grammar
the click on the tabView Diagram
to see/download a navigable railroad diagram.