-
Notifications
You must be signed in to change notification settings - Fork 38
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
Grammar railroad diagram #44
Comments
The above EBNF is not correct somenone pointed out that my naive interpretation of menhir grammar like bison grammar is not correct (mainly rules starting with I'm working to fix it. |
I have edited the EBNF from the first message to fix several issues with the tool I used to create it. |
Thanks to introduce your tool, it recalled to me a tool I used several years ago (maybe ebnf2ps between 1995 and 2000). Instead of postscript figures your tool gives a more usable output, that is a good point. But, it is difficult to use in our development such a tool until there is no automatic tool chain from the original grammar file (used by parser generators such as yacc, menhir, ...). At least, that requires a translator of these source formats into the format required by your tool to cope with the modification of the source file. Tags inserted as comments into the source file should also be usable by the translator to control the final output. It could be a way to specify the rules to inline in order to simplify the final figures and retrieve something closer to the grammar figures of the ACSL document. For the same reason, theses tags should allow the renaming of some nodes (because the source file may not use the same names than the ACSL document). Finally, the same kind of feature could be helpful for the lexical definitions of the grammar tokens. What do you suggest to solve these engineering difficulties? |
Ask or modify Here is the custom parser I created for
|
I've done a experimental tool to convert bison grammars to a kind of EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams see bellow the converted
src/kernel_internals/parsing/cparser.mly
and with some hand made changes to allow view it at https://www.bottlecaps.de/rr/ui the order of the rules could be changed to a better view of the railroad diagrams. Copy and paste the EBNF bellow on https://www.bottlecaps.de/rr/ui tab Edit Grammar then switch to the tab View Diagram.The text was updated successfully, but these errors were encountered: