9

enter image description here

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

3 Answers3

16

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.

Mark Rushakoff
  • 1,734
  • 14
  • 14
7

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.

John R. Strohm
  • 18,043
  • 5
  • 46
  • 56
3

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.

knut
  • 1,398
  • 1
  • 10
  • 16