-
Notifications
You must be signed in to change notification settings - Fork 37
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 #3
Comments
Thanks for the suggestion! These will look nice in our documentation. Keeping this issue open as as a reminder. I do think some parts of the grammar may still change on our way to 1.0 release, but others should be stable. |
@mingodad @burakemir, there are railroad generation tools for ANTLR. If you can let me know which directory you want them in, I can add a script for generating them / Just insert the railroad diagrams. |
Let's maybe start with an svg for plain Datalog atoms / facts first, with recursion and negation? However the mangle syntax evolves (the syntax in first post is already outdated, since map and struct constants were added), one needs to understand this core first. (edit: formatting)
|
It's on a matter to pass https://raw.githubusercontent.com/google/mangle/main/parse/gen/Mangle.g4 through https://www.bottlecaps.de/convert/ and then click |
Just to explain why I am hesitating here: there are still a few minor grammar changes that need to be done, see e.g. #27 and possibly something that lets users define types. |
I've just added a The grammar there has some small changes because as it is in this project there is several conflicts mainly due to |
Very cool! I just made a small change to the grammar, to get more readable type syntax. See the new DOT_TYPE variant for non-terminal term. |
Using some online tools like https://www.bottlecaps.de/rr/ui and https://www.bottlecaps.de/convert/ we can have a nice navigable railroad diagram.
Copy and paste the
EBNF
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.The text was updated successfully, but these errors were encountered: