Next: , Up: ASN.1 structure handling   [Contents][Index]


2.1 ASN.1 syntax

The parser is case sensitive. The comments begin with -- and end either with another --, or at the end of the respective line, whichever comes first. The C-style /*, */ comments are not supported.

For an example of the syntax, check the pkix.asn file distributed with the library.

ASN.1 definitions must follow the syntax below:

      definitions_name {<object definition>}

      DEFINITIONS <EXPLICIT or IMPLICIT> TAGS ::=

      BEGIN

      <type and constants definitions>

      END

The ::= token must be separate from other elements, so the following declaration is invalid:

   -- INCORRECT
   Version ::=INTEGER

The correct form is:

   Version ::= INTEGER

Here is the list of types that the parser can manage:

This version doesn’t handle the REAL type. It doesn’t support the AUTOMATIC TAGS option, and the EXPORT and IMPORT sections, either.

The SIZE constraints are allowed, but no check is done on them.