What is the effective tagging environment in case of an imported type?

前端 未结 1 1010
花落未央
花落未央 2021-01-28 04:03

As an example let\'s assume the following setup:

A module definition A that has a tagging environment of explicit tags defines a type foo. And Module B with implicit tag

1条回答
  •  醉梦人生
    2021-01-28 04:09

    First, an import is not a textual thing like #include in C. It simply makes types in other modules accessible without qualifying them using their module name.

    X.680 13.1 Note 4 speaks specifically to your question:

    The value of "TagDefault" for the module definition affects only those types defined explicitly in the module. It does not affect the interpretation of imported types.

    Note, however, that if in module B (where foo was imported), you write:

    Bar ::= [APPLICATION 5] Foo

    This would be equivalent to:

    Bar ::= [APPLICATION 5] IMPLICIT Foo

    because in module B, where the TaggedType is being defined, the tagging environment is implicit.

    What the note means is that, if in Module A, you had:

    Foo ::= SEQUENCE { x [0] INTEGER }

    then the tag on x is an EXPLICIT tag because the tagging environment in module A was explicit and that Foo will always be treated this way, even when being imported into module B with its implicit tagging environment.

    0 讨论(0)
提交回复
热议问题