-
Notifications
You must be signed in to change notification settings - Fork 82
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 #1096
Comments
This is interesting. SYNC is a COCO/R keyword for error recovery/handling (IMHO there should also be "WEAK" or similar) for your purpose you should filter it out. I'm a fan of Coco and used it in various versions over the years. I like it very much, because it makes it rather simple to create simple grammars and robust lexer and parsers. It is sad that is is not as well know as lex bison, ANTLR or similar tools. I thought about switching from time to time to have a more knows parser, but there was just no real benefit. I would like to make use of our work by adding such processing step and image to the documentation. See https://github.com/Framstag/libosmscout/blob/master/.github/workflows/webpage.yml for the current documentation build. Is there any way to automate things with a small effort? Is your interest in libosmscout or Coco/R? |
Here is the parser I use to do the conversion, it requires a bit of manual work after but with a bit of effort probably it could do it all alone. I use it with an scripting language with a syntax very close to C/C++/Java/CSharp https://github.com/mingodad/squilu , It's basically the original
|
After thinking a bit on the issue pointed bellow I implemented the
|
Looking for people using CocoR I found this project and I've done a experimental tool to convert CocoR grammars to a kind of EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams see bellow the converted and with some hand made changes of
OST.atg
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.Cheers !
The text was updated successfully, but these errors were encountered: