Skip to main content

Railroad diagrams

Posted by cayhorstmann on July 5, 2006 at 11:35 PM PDT

Whatever happened to "railroad diagrams" like this one?


I always liked these, maybe because I learned Pascal at an early age.
David Geary and I use them in our Core
book, but, truth be told, that was my pet thing, and David found
them weird.

I just wrote up a description of the @OrderBy annotation in
the href="">Java
Persistence Architecture, and I ran across the following description
in the spec:

orderby_list::= orderby_item [,orderby_item]*
orderby_item::= property_or_field_name [ASC | DESC]

This describes what you can have in the value attribute,

@OrderBy(value="name, score DESC")

I have no problem reading BNF, but I wasn't so sure about href="">Elvis.
I thought a railroad diagram would be easier to understand:


I wasted a whole day tweaking href="">Violet to draw railroad diagrams
after a Google search turned up href="">this
Haskell based tool and href="">this
LaTeX based tool, and nothing else.

??? style="float:left; padding-right: 1em;" />Are the days of the railroad
over, or do railroad diagrams still have their place? Do you have any
recommendations for drawing tools?