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 possible, braces and the pipe symbol are the preferred method to show alternative options.

On some pages 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 the case of the CSS pages the curly brackets { } are omitted from the syntax diagrams to avoid any confusion with the curly brackets that are part of actual CSS rules.

In some older texts BNF is also referred to as Backus-Naur Form.

Related:

ISO Standard for BNF
Wikipedia entry for BNF
Chomsky Normal Form


© Copyright SS64.com 1999-2013
Some rights reserved