-
Notifications
You must be signed in to change notification settings - Fork 20
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 #344
Comments
@mingodad, FWIW, we've written a specification for the Protobuf language, and that also includes a grammar that is intended to be human-readable: https://protobuf.com/docs/language-spec |
@jhump thank you for reply ! |
The site that hosts the language spec also contains some other parser examples, including an ANTLR grammar configuration: https://protobuf.com/docs/examples |
Thank you again ! |
@mingodad, thanks for pointing that out. I've updated the site so it now points to the latest release instead (0.14.1). |
Hello @jhump I'm not sure that it's right because comparing the content of the links there is no difference. |
There over ~1400 lines changed, just in the file If you are referring to changes between that latest version and the railroad diagram you created above, it appears you are correct that there is no difference. It looks like you made that diagram based on the latest version, not based on the very old version that was previously linked from the protobuf.com page. FWIW, the grammar in the protobuf.com site, and in the other example grammars, is much more accurate. The |
@jhump thank you again for reply ! Now I've got the spec here https://github.com/bufbuild/protobuf-language-spec/blob/main/language-spec.md?plain=1 and manually separated the
|
I've just added this project grammar to https://mingodad.github.io/parsertl-playground/playground/ an
Yacc/Lex
compatible online editor/tester (selectProtocompile parser
fromExamples
then clickParse
to see a parse tree for the content inInput Source
), it also generate anEBNF
understood by (IPV4) https://rr.red-dove.com/ui or (IPV6) https://www.bottlecaps.de/rr/ui to generate a nice navigable railroad diagram (see instruction bellow at the top).I hope it can help develop/debug/document this project grammar.
The text was updated successfully, but these errors were encountered: