What is the efficient tag environment for an imported type?

As an example, let’s say the following setting:

The definition of module A, which has an explicit tag tag environment, defines the type foo. And module B with an implicit tagging region imports foo and assigns it to bar.

When reading a stream using module B, it is not clear to me which tagging medium is effective. Does module B include a tagging environment (implicit) of the string (foo is imported) or is the tagging environment of the module in which it was declared (foo in module A, for which it is explicit) effective?

I hope I have explained the problem well enough.

0
source share
1 answer

Firstly, the import is not textual, for example, #include in C. It simply makes types in other available modules without qualifying them using the name of its module.

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

The TagDefault value for the module definition affects only those types that are explicitly defined in the module. This 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 will be equivalent to:

Bar :: = [APPLICATION 5] IMPLICIT Foo

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

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

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

then the tag in x is an EXPLICIT tag because the tag environment in module A was explicit and that Foo will always be processed this way even if it is imported into module B with its implicit tag environment.

+2
source

All Articles