Closed mingodad closed 5 days ago
Hello @mingodad,
first of all thank you for supporting parol
in your project.
I tried a bit with your web site and I only was able to produce EBNF from the parol grammar itself and not from other grammars written in parol's syntax. E.g., if you paste the grammar from https://github.com/jsinger67/parol_grammars/blob/main/grammars/prop_cal.par into the Input source pane it parses it flawlessly and the parse tree is visualized. But when you choose to generate EBNF grammar the content of clippboard always seems to be the same as in the lower left pain. Maybe I handle it wrong.
I like your suggestion to generate railroad diagrams for grammars written in parol's syntax. I'll think about it thoroughly.
You are right it only generate EBNF
, SQL
, C++
code for the grammar on the left editor the Input source
is just that the input to the grammar on the left.
I see. No problem. I ranked the issue as enhancement. I also will add the 'help wanted' tag. Let's see if anyone can jump in. Otherwise, I'll schedule it for myself because I'm really conviced that this improvement could help users a lot. Thanks again 👍
Maybe an idea how to get around the problem. Create a small tool that reads in parol grammars and outputs an EBNF format, that the tool mentioned above can understand.
Can be solved by an extra application as proposed in my last comment.
To parse parol syntax create a bin crate with
parol new ...
and use parol's parol.par grammar description to create a parser for it. Then write a simple converter to EBNF.
Therefore I close this issue.
I've just added
parol
grammar to https://mingodad.github.io/parsertl-playground/playground/ anYacc/Lex
compatible online editor/tester (selectParol parser
fromExamples
then clickParse
to see a parser tree for the content inInput source
), it can also generate an EBNF understood by https://github.com/GuntherRademacher/rr to generate a nice navigable railroad diagram (see bellow) and a SQL description of the grammar too.Would be nice if
parol
could also generate then.