News for hackers. Stuff that matters.
Re:Fixing Left and Mutual Recursions in Grammars by tempodox on Sunday February 02, 2025 @04:27AM (#42907440)
An interesting and worthwhile topic. This kind of problem pops up regularly.

Those diagrams are really handy, does anyone know how they were made? I'm always looking for alternatives / companions to the Railroad Diagram Generator (https://rr.red-dove.com/ui).

Re:Fixing Left and Mutual Recursions in Grammars by Rochus on Sunday February 02, 2025 @06:04AM (#42907886)
These diagrams indeed look good. But actually I never use those for parser construction, but consider EBNF more useful, especially also when analyzing and correcting a grammar. I was surprised that there was no decent editor to develop grammars which has built-in support to find and show issues in the grammar like left recursion or ambiguities (at least I didn't find one), so I implemented my own: https://github.com/rochus-keller/ebnfstudio/. I used it in all of my programming language projects to create LL(n) versions including some pretty complicated grammars like Simula or Verilog.
Re:Fixing Left and Mutual Recursions in Grammars by aardshark on Sunday February 02, 2025 @06:17AM (#42907938)
draw.io can do similar diagramming. You can generate diagrams programmatically through their CSV format.

Unfortunately documentation for using it programmatically is a bit lacking, but you can for example host a CSV somewhere and use their editor to load it. It's all client side so will automatically update.

Re:Fixing Left and Mutual Recursions in Grammars by brightprogramer on Sunday February 02, 2025 @04:28AM (#42907446)
Re:Fixing Left and Mutual Recursions in Grammars by werdnapk on Sunday February 02, 2025 @10:25AM (#42909211)
Isn't Graphviz [1] the standard tool for this?

[1] https://graphviz.org/