Structured types encoding

SET, SEQUENCE, SET OF, SEQUENCE OF

The encoding of these values is naturaly constructed. It contains nested encodings of each component value. In the case of SEQUENCE and SEQUENCE OF types, the order of values is meaningful and thus must be preserved.

You will not probably read following examples but just the text is not too short...

and two more encoding are possible.


CHOICE

The encoding of CHOICE type is precisely that of the cosen alternative. Having

the values

would be encoded as


ANY

The encoding of ANY valy is precisely that of the selected value of the selected type. Thus, the value INTEGER -129 of type ANY is encoded as:


Tagged types

The encoding of values of a tagged type depends on tagging style - whether it is implicit or explicit. If the tagging is implicit, the tag of encoding in identifier is replaced by applied one. But if the tagging is explicit, both standard (the type reflecting) and applied tag are conveyed. This implies that all explicit tagged types are constructed.

Consider the example of INTEGER value -27066. The standard encoding would be:

If the value is given an implicit tag of [5], encoding will change to:

If an implicit [APPLICATION 35] tag is given:

But if an explicit tag of [5] is applied, explicit tag is conveyed in identifier of constructed type, while standard tag of INTEGER is held in nested encoding: