To unambiguously define the structure of new RIFF forms, document the RIFF form using the basic notation along with the following extended notation:
Notation
<NAME-ck> <GOBL-form> <bitmap-bits> <foo>
Conventionally, a label that refers to a chunk is named <ckID-ck>, where 'ckID' is the chunk ID. Similarly, a label that refers to a RIFF form is named <formType-form>, where "formType" is the name of the form's type. <name> elements
This states that <name> is an abbreviation for elements, where elements is a sequence of other labels and literal data. An example follows:
<GOBL-form> RIFF ( 'GOBL' <form-data> )
This example defines label <GOBL-form> as representing a RIFF form with chunk ID 'GOBL' and data equal to <form-data>, where <form-data> is a label that would be defined in another rule. Note that a label may represent any data, not just a RIFF chunk or form. <name:type>
<name> <type>
This allows you to give a symbolic name to an element of a file format and to specify the element data type. An example follows:
<xyz-coordinate> <x:INT> <y:INT> <z:INT>
This defines <xyz-coordinate> to consist of three parts concatenated together: <x>, <y>, and <z>. The definition also specifies that <x>, <y>, and <z> are integers. This notation is equivalent to the following:
<xyz-coordinate> <x> <y> <z> <x> <INT> <y> <INT> <z> <INT>[elements]
<FOO-form> RIFF('FOO' [<header-ck>] <data-ck>)
This example defines form "FOO" with an optional header chunk followed by a mandatory data chunk. el1 | el2 | ... | elN
<hdr-ck> hdr(<hdr-x> | <hdr-y> | <hdr-z>)
This example defines the 'hdr' chunk's data as containing one of <hdr-x>, <hdr-y>, or <hdr-z>. element...
<data-ck> data(<count:INT> <item:INT>...)
This example defines the data of the 'data' chunk to contain an integer <count>, followed by one or more occurrences of the integer <item>. [element]...
<data-ck> data(<count:INT> [<item:INT>]...)
This example defines the data of the 'data' chunk to contain an integer <count> followed by zero or more occurrences of an integer <item>. {elements}
<blorg> <this> | {<that> | <other>}...
This example defines <blorg> to be either <this> or one or more occurrences of <that> or <other>, intermixed in any way. Contrast this with the following example:
<blorg> <this> | <that> | <other>...
This example defines <blorg> to be either <this> or <that> or one or more occurrences of <other>. struct { ...} name
<3D_POINall struct { INT x; /* X-coordinate */ INT y; /* Y-coordinate */ INT z; /* Z-coordinate */ } 3D POINTBecause these types are more portable than C types such as int. The structure fields are assumed to be present in the file in the order given, with no padding or forced alignment.
Unless the RIFF chunk ID is 'RIFX', integer byte ordering is assumed to be in Intel format. /* comment */
<weekend> 'Sat'|'Sun' /* Four-character code */ /* for day */