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
JSF
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="http://www.jcp.org/aboutJava/communityprocess/final/jsr220/index.html">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,
e.g.

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

I have no problem reading BNF, but I wasn't so sure about href="http://www.horstmann.com/elvis/elvis-meets-glassfish.html">Elvis.
I thought a railroad diagram would be easier to understand:

???

I wasted a whole day tweaking href="http://horstmann.com/violet">Violet to draw railroad diagrams
after a Google search turned up href="http://www.informatik.uni-freiburg.de/~thiemann/haskell/ebnf2ps/">this
Haskell based tool and href="http://homepages.inf.ed.ac.uk/wadler/realworld/syngen.html">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?