Railroad diagrams are a way to visualize context-free grammars.
You read the diagram from left to right and from top to bottom. The diagram is a visual representation of a context-free grammar. The diagram shows the rules of the grammar and how they are connected.
The following conventions are used:
- The following diagram shows values
A
,B
andC
, which must be specified. The required values are defined on the main line of the diagram. (ABNF:and = A B C
)
- The following diagram shows the optional value
A
. The value can be bypassed by following the empty path. (ABNF:opt = [A] B
)
- In the example below
A
,B
andC
are options. The value can be chosen from the options. (ABNF:or = A / B / C
)