C.1 The NetCDF Classic Format Specification
To present the format more formally, we use a BNF grammar notation. In
this notation:
- Non-terminals (entities defined by grammar rules) are in lower case.
- Terminals (atomic entities in terms of which the format specification
is written) are in upper case, and are specified literally as US-ASCII
characters within single-quote characters or are described with text
between angle brackets (‘<’ and ‘>’).
- Optional entities are enclosed between braces (‘[’ and ‘]’).
- A sequence of zero or more occurrences of an entity is denoted by
‘[entity ...]’.
- A vertical line character (‘|’) separates alternatives. Alternation
has lower precedence than concatenation.
- Comments follow ‘//’ characters.
- A single byte that is not a printable character is denoted using a
hexadecimal number with the notation ‘\xDD’, where each D is a
hexadecimal digit.
- A literal single-quote character is denoted by ‘\'’, and a literal
back-slash character is denoted by ‘\\’.
Following the grammar, a few additional notes are included to specify
format characteristics that are impractical to capture in a BNF
grammar, and to note some special cases for implementers. Comments in
the grammar point to the notes and special cases, and help to clarify
the intent of elements of the format.