Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to emit EBNF for railroad diagram #30

Open
mingodad opened this issue May 25, 2023 · 2 comments
Open

Add an option to emit EBNF for railroad diagram #30

mingodad opened this issue May 25, 2023 · 2 comments

Comments

@mingodad
Copy link

I did an extension to emit an EBNF understood by https://www.bottlecaps.de/rr/ui to create railroad diagrams from the grammars see here satya-das/cppparser#16 .

I think that it's a good addition to this tool I also did the same for bison/byacc/lemon here https://github.com/mingodad/lalr-parser-test .

Cheers !

@ChrisDodd
Copy link
Owner

I added a pull request ( #31 ) for what I think is the patch you're referring to? Looks pretty simple and straight-forward

@mingodad
Copy link
Author

mingodad commented May 26, 2023

Thank you !
I also added a similar simple option to bison/byacc/lemon to output the naked grammar too, see here https://github.com/mingodad/lalr-parser-test/blob/a762d4987c3172e9bee91cd216656c97711534f1/byacc/reader.c#L4290 for byacc, it helps when we want to reuse the grammar to other purposes and also to debug because it makes easy to compare two versions of a grammar at syntactical level (without action code and in a normalized way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants