George V. Reilly

Railroad Diagrams (Syntax Diagrams)

Railroad Diagrams

Railroad diagrams aka syntax diagrams have never really taken off. I’ve only come across two memorable uses of them, in a Pascal textbook that I used as a freshman and on JSON.org. The former was surely influenced by Niklaus Wirth’s Pascal User Manual, which also used them. For com­mu­ni­cat­ing with laypeople, the simple diagrams convey much more in­for­ma­tion than a textual grammar.

There are a few tools which can generate such diagrams from EBNF grammars, including the online Railroad Diagram Generator and the Railroad-diagram Generator library. Other tools can be found in the answers to the Stack­Over­flow question.

blog comments powered by Disqus
Being A Developer After 40 » « Review: Spy Line