Biksel Mode and Format Notation — Quick Reference

The notation described here is not part of the C programming language, and is not understood by the C compiler. However, it is useful for documenting Biksel programs and should be used within comments.

Mode expressions

The following are listed in decreasing order of operator precedence with operators of equal precedence grouped together:

Name primitive mode
() empty mode sequence
mode1 >> mode2 mode1 followed by mode2
mode1 | mode2 mode1 or mode2

Mode declarations

// Constraint
Mode (parameter): mode

// Constraint with transition
Mode (parameter): mode -> mode

// Constraint with conditional transition
Mode (parameter): mode
 -> mode  (condition)
  | mode  (condition)
  

In the above, condition may be written informally or may be a C expression. Each condition may depend on the arguments and return value of the procedure to which the mode declaration applies.

In all of the above, parameter may be replaced by a comma-separated list of parameters.

Format expressions

The following are listed in decreasing order of operator precedence with operators of equal precedence grouped together:

Name named format
parameter format template parameter
() empty format, i.e. zero bits of data
"Tag" enumeration tag, represented as Int32
[format] equivalent to ListOf format
Name format1 formatn instance of format template
format1 >> format2 format1 followed by format2
format1 | format2 format1 or format2

Defining formats

// Format
format Name = format

// Format template
format Name parameter1  parametern = format

File format declarations

// The named file shall have the given format.
name :: format