The general mapping procedure is to iterate over the Definitions
in the DefinitionList
and to map each Definition
as follows.
Let csnstr be the CSN1String
of the Definition
. Invoke the CSN1String mapping procedure for csnstr.
If the mapping of csnstr produces either an ASN.1 type or an ASN.1 component, then an ASN.1 TypeAssignment
, TA, is produced for this Definition
. The "typereference" for TA is obtained by invoking the procedure for mapping a CSN.1 name to a typereference. The "Type" for TA is specified in the following clauses. If the mapping of csnstr did not produce any ASN.1, then no ASN.1 is produced for this Definition
.
If an ASN.1 type, T, was produced, this is the type for TA.
Otherwise, if an ASN.1 component, C, was produced, the type for TA is a SEQUENCE
, S, defined as follows.
S shall consist of a single component, namely C.
If C was produced without a label name, the component name shall be "component-1".
Otherwise (C was produced with a label name), the component name shall be obtained by invoking the procedure for mapping a CSN.1 name to an ASN.1 identifier.
The optionality and type for C will already have been specified by the procedure that produced C.
The encoding for S is the encoding for C, which will have been specified by the procedure that produced C.
Finally, if any of the procedures invoked for mapping the Definitions
in the DefinitionList
specified that the special LHType
should be produced, then produce the special LHType
defined as follows:
The ASN.1 definition is given as LHType ::= ENUMERATION { lbit(0), hbit(1) }
The encoding for LHType is a single bit, an L for lbit and and H for hbit (see the discussion of L/H bits in the section on CSN.1 syntax).
All of the ASN.1 items produced by these procedure are added to the ASN.1 module identified by the asn1_typeReference
given in the Module
.
The mapping procedures (this one included) do not ensure that type or component names are unique. If unique names are not produced so that the ASN.1 is in error, then the CSN.1 specification is considered to be in error as well, for the purposes of the mapping. To resolve this problem, the CSN.1 must be adjusted.