Determinants

The alternatives in an alternation are divided into two parts, a determinant and a remainder. Determinants are literal bit strings used to signal which of the alternatives is encoded in an encoding. This section describes how to determine the determinant and remainder for an alternative.

  1. If the alternative is empty (i.e. it consists of just the null terminal), there is no determinant and the remainder is empty. This alternative is called the null alternative.

  2. If the alternative is a Concatenation or a single literal, the determinant is the longest string of literals that begins the alternative (note: the use of null in concatenation is superfluous and ignored). If this string is empty, the alternative does not have a determinant. The rest of the alternative is the remainder.

  3. If the alternative is a Reference that resolves to a single literal, or a concatenation of literals, those literals form the determinant. The remainder is empty.

  4. Otherwise, the alternative does not have a determinant and the remainder part is the entire alternative.

A determinant could be written using exponentiation. e.g. (10)*2 instead of 1010. To keep things simple, we do not support this.