The rules that apply to the railroad track syntax diagrams are as follows:
The >>-- symbol indicates the beginning of a
statement.
The --> symbol indicates that the statement syntax
is continued on the next line.
The >-- symbol
indicates that a statement is continued from the previous line.
The -->< symbol indicates
the end of a statement.
Diagrams of syntactical units other that complete statements start
with the >-- symbol
and end with the --> symbol.
>>---STATEMENT---required_item------------------------------><
>>---STATEMENT--+-----------------+------------------------->< +--optional_item--+
>>---STATEMENT--+-required-choice1-+------------------------>< +-required-choice2-+
If choosing one of the items is optional, the entire stack appears below the main path.
>>---STATEMENT--+------------------+------------------------>< !-optional-choice1-! +-optional_choice2-+
+--default_choice--+ >>---STATEMENT--!------------------!------------------------>< !-optional-choice1-! +-optional_choice2-+
+-----------------+ v ! >>---STATEMENT----repeatable-item-+-------------------------><
A repeat arrow above a stack indicates that you can repeat the items in the stack.