question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax diagram generation

See original GitHub issue

Suggestion Provide a clear and concise description of what the problem is, what you want to happen.

How difficult would it be to add a generator of syntax diagrams for lark? Like this one: https://www.bottlecaps.de/rr/ui

Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.

I tried converting the lark syntax into the EBNF convention they use for those diagrams. Doing a string replace of : for ::= gets you a long way, but the aliases and a few operators create problems. I was just wondering whether the internal representations of lark already provide an easy way to do something like that.

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
erezshcommented, Apr 28, 2020

Cool. If it works I’ll find somewhere in the codebase to add it.

1reaction
MegaIngcommented, Apr 28, 2020

I create a simple generator using railroad, which is a perfect fit for the lark Transformer way of work: https://github.com/MegaIng/lark-railroad. Results are useable, and include links from rules to each other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Railroad Diagram Generator
Welcome to Railroad Diagram Generator! This is a tool for creating syntax diagrams, also known as railroad diagrams, from context-free grammars specified in ......
Read more >
Syntax diagram - Wikipedia
Syntax diagrams (or railroad diagrams) are a way to represent a context-free grammar. They represent a graphical alternative to Backus–Naur form, EBNF, ...
Read more >
Basic Syntax Diagrams - The Document Foundation Wiki
Diagrams generation is only illustrated using either Railroad Diagram Generator from Gunther Rademacher, either Railroad Diagrams by Tab ...
Read more >
Syntax diagram generator
This is a demonstration of a pure-rust library to generate syntax diagrams for macro_rules!(). Diagrams are generated fully automatically from rust-source ...
Read more >
Syntax Diagrams | Chevrotain
This document contains instructions on how to generate Syntax railroad diagrams for a Chevrotain grammar using the railroad-diagrams ; Chevrotain ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found