Subclass: '==' CSN1String | ':=' INTEGER SubclassOpt: /* empty */ | Subclass
A subclass expression is meant to be applied to a reference as a way of further restricting the referenced string (3GPP 24.007 does not discuss subclassing; this comment is based on non-official resources). This makes it a way of specifying that a particular value should be present in the encoding and that this string is one of those strings matched by the given reference. For example, <message_type: bit(4) == 0101>
is a way of saying message_type is a 4-bit value and should be '0101'.
In practice, subclass expressions are applied not only to references, but also to exponentiated references (as in the above example, where it is applied to bit(4)).
The CSN1String
in the first alternative must be a string of one or more literals.
The second alternative specifies an integer value. Obviously, this requires knowing how many bits should be used to encode that integer value, which means the reference (with exponent, if given) must have a fixed length.