I\'m reading \"Javascript, The Good Parts\" by Douglas Crockford, and having a difficulty understanding the use of all the railroad diagrams. He also doesn\'t elaborate much
I am also reading this book. It takes me a long time, but finally understand Railroad Diagrams.
First, as @ChuckCottrill mentioned, you should have a basic acknowledge about Syntax Diagrams and BNF/EBNF. But after reading that, it still confused me until I compare three graphs of different situation:
zero or more, zero or one, one or more
To understand their differences (as the following picture shows), the point is "You start on the left edge and follow the tracks to the right edge." So imagine you are the train, you just turn right, cannot turn left.
the above picture created by http://bottlecaps.de/rr/ In the "Edit Grammar" tab, input the following grammar:
zeroormore ::= element*
zeroorone ::= element?
oneormore ::= element+