Syntax diagrams - Backus Normal Form (BNF)
The syntax definitions on this site use a variant of Backus Normal Form (BNF) that includes the following:
[ ] Brackets enclose optional items.
{ } Items of which only one is required.
| A vertical pipe separates alternatives (OR)
underlined The default option
... The preceding item can be repeated (as many times as needed)
UPPER CASE Command that should be entered as shown
lowercase&italic Variable that should be replaced with an appropriate value
Where a command is too long to fit on a single line it is wrapped
with each subsequent line indented:
COMMAND option option option option option option option option
option option option option option option option option
option option option option
Where there are several optional items and you can choose any,several or all
these are shown in a list, all indented to the same degree:
COMMAND option option
option
option
If further command options follow they will be indented:
COMMAND option option
option
option
option option option
If the options have sub options they are individually indented:
COMMAND option option
option option option
option
option option
option
option option option
Where there are several optional items and you can choose only one from
the list, they are indented and separated by a blank line
COMMAND option option
option
option
This is the same as COMMAND option {option | option | option}
Where the layout makes it possibe, braces and the pipe symbol are the preferred method to show alternative options.
This syntax is not always followed rigourously e.g. on a page where almost everything is a variable, to improve readability some variables may be left as lower case but not italic.
Similarly option [,option] [,...] may be abbreviated to just option ,... this is to avoid having a surfeit of brackets around the more complex commands.
Bold text is used to highlight some key items but does not have any syntactic importance.
In some older texts BNF is also referred to as Backus-Naur Form.
Related: