Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

I'd also want to know how can I draw them.

share|improve this question
online railroad diagram drawer – Esailija Apr 22 '13 at 14:22
Also sometimes called "grammar diagrams", I think. – FrustratedWithFormsDesigner Apr 22 '13 at 14:25
up vote 16 down vote accepted

That looks like SQLite's syntax diagrams.

Their FAQ says:

How are the syntax diagrams (a.k.a. "railroad" diagrams) for SQLite generated?

The answer is a link to this wiki page on "Generating Syntax Diagrams Using Tk".

The wiki links to this Tcl source code for generating the diagrams.

share|improve this answer

That is a syntax diagram. I think I first saw them in Grogono's "Programming in Pascal", from 1980, but they were used in Wirth's 1973 report on PASCAL.

share|improve this answer

Just a hint for LaTeX-Users:

The rail-package allows the generation of such rail-diagramms with (La)TeX.

You may check TeX.SX for an example.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.