Welcome to Railroad Diagram Generator! This is a tool for creating syntax diagrams, also known as railroad diagrams, from context-free grammars specified in EBNF. Syntax diagrams have been used for decades now, so the concept is well-known, and some tools for diagram generation are in existence.. Straight Line Track Diagrams - Grade Profiles The railroad as the engineer sees it. Often includes bridges, sidings, stations, grades and curvature. Sometimes includes maintenance and signaling information, orientation map of areas covered.
Railroad diagrams are a way of visually representing a grammar in a form that is more readable than using regular expressions or BNF. They can easily represent any context-free grammar, and some more powerful grammars. There are several railroad-diagram generators out there, but none of them had the visual appeal I wanted, so I wrote my own... Railroad diagrams are called this due to the visual play of imagining you are a little train going down its tracks from beginning to end. Choo-choo!! Some railroad diagrams have only one path while others have several alternate paths like loops, choices or options. More complex railroad diagrams can consist of many alternate paths, or nested.