this is done semi-automatically using the asn1msgs.pl script.
If we avoid using Information Object Classes in the IE definitions (which are only used for Extension Containers), then we can compile the ASN.1 source using Lev Walkin's asn1c.