Open mingodad opened 3 years ago
Thanks! It's really cool to see some of the more complex rules (e.g., NamespaceDeclaration
) through that lens. 😄
If I wanted to use this for documentation, I'd probably want to do two things
NsQualifiedId
and NsQualifiedIdImpl
only exists for their parser side effects. Would probably be fine to manually maintain a list of productions to be "inlined" by your conversion tool.I realize that this response is years too late 😅 but I wanted to express my appreciation for your work regardless.
I've extended CocoR
to output the EBNF
here https://github.com/mingodad/CocoR-CSharp/blob/af4b887fa7903edbdbb9d67278dd5855ce717fac/src/ParserGen.cs#L457 also for the Java/C++/Typescript
ports:
The Typescript
port has an online playground here https://mingodad.github.io/CocoR-Typescript/playground .
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
myamalgamation_of_peroxite.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 !