Open mingodad opened 2 years ago
Hello @mingodad, thanks for creating this issue, it is an interesting feature.
Maybe the same output can also be generated by providing a target language description file? It could be thought of a possibility to turn a unicc parser into a EBNF-format for this website by just specifiying unicc -l ebnf-bottlecaps grammar.par
.
It seems to me that it's more code and complicated to use https://github.com/phorward/unicc/tree/master/targets
It seems to me that it's more code and complicated to use https://github.com/phorward/unicc/tree/master/targets
You're partly right. The current features there don't satisfy to resolve your proposal.
Well, the feature is probably useful, but I think it shouldn't make it into unicc, as unicc is not actively continued right now and there also no plans to do so by me currently.
You should either bring this feature to unicc2, as this is the only candidate for an improved version of unicc, or create a fork of unicc-v1 with the features you would like to add.
I've just added unicc grammar to https://mingodad.github.io/parsertl-playground/playground/ an Yacc/Lex
compatible online editor/tester (select Unicc parser
from Examples
then click Parse
to se a parse tree for the content in Input source
).
I've just added unicc grammar to https://mingodad.github.io/parsertl-playground/playground/ an
Yacc/Lex
compatible online editor/tester (selectUnicc parser
fromExamples
then clickParse
to se a parse tree for the content inInput source
).
Hello @mingodad, thanks for sharing, looks fine and works!
Based on the
debug.c:dump_productions
function I created adebug.c:dump_ebnf
function to output an EBNF grammar understood on https://www.bottlecaps.de/rr/ui to generate railroad diagrams (https://en.wikipedia.org/wiki/Syntax_diagram) and as example bellow is the one forparse.par
.Copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui in the TAB Edit Grammar then switch to the TAB View Diagram.