Next: Naming, Up: ASN.1 structure handling [Contents][Index]
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:
INTEGER
;
ENUMERATED
;
BOOLEAN
;
OBJECT IDENTIFIER
;
NULL
;
BIT STRING
;
OCTET STRING
;
UTCTime
;
GeneralizedTime
;
GeneralString
;
NumericString
;
IA5String
;
TeletexString
;
PrintableString
;
UniversalString
;
BMPString
;
UTF8String
;
VisibleString
;
SEQUENCE
;
SEQUENCE OF
;
SET
;
SET OF
;
CHOICE
;
ANY
;
ANY DEFINED BY
.
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.