I’d also want to know how can I draw them.
2
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.
0
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.
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.