Question

I'm trying to determine if the ORDER of Type Assignments in an ASN.1 Module has any meaning. Is ASN.1 similar to a one-pass compiler, where as-yet-unseen types are invalid?

For example, take the following ASN.1 Module:

MySchema DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
    IntType ::= INTEGER
    OtherType ::= IntType
END

Here we define IntType to be an INTEGER, and then OtherType to be IntType.

If instead, we reversed the order, and said:

MySchema DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
    OtherType ::= IntType
    IntType ::= INTEGER
END

Here, when the ASN.1 compiler encounters IntType for the first time, it would not have seen the Type Definition yet. Does this make it illegal syntax?

Was it helpful?

Solution

Assignments are allowed to appear in any order. This is true of all kinds of assignments (type assignments, value assignments, object assignments, and so on). Recursive definitions are also allowed so long as there is a way to interrupt the recursion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top