12 Scope and visibility
12.1 Declarative region
With two exceptions, a declarative region is a portion of the text of the description.
A single declarative region is formed by the text of each of the following:
-
a) An entity declaration, together with a corresponding architecture body
-
b) A configuration declaration
-
c) A subprogram declaration, together with the corresponding subprogram body
-
d) A package declaration together with the corresponding body (if any)
-
e) A record type declaration
-
f) A record nature declaration
-
g) A component declaration
-
h) A block statement
-
i) A process statement
-
j) A simultaneous procedural statement
-
k) A loop statement
-
l) A block configuration
-
m) A component configuration
-
n) A generate statement
-
o) A protected type declaration, together with the corresponding body
In each of these cases, the declarative region is said to be associated with the corresponding declaration or statement. A declaration is said to occur immediately within a declarative region if this region is the innermost region that encloses the declaration,
not counting the declarative region (if any) associated with the declaration itself.
Certain declarative regions include disjoint parts. Each declarative region is nevertheless
considered as a (logically) continuous portion of the description text. Hence, if
any rule defines a portion of text as the text that extends from some specific point of a declarative region to the end of this region, then
this portion is the corresponding subset of the declarative region (thus, it does
not include intermediate declarative items between the interface declaration and a
corresponding body declaration).
In addition to the preceding declarative regions, there is a root declarative region, not associated with a portion of the text of the description, but encompassing any
given primary unit. At the beginning of the analysis of a given primary unit, there
are no declarations whose scopes (see 12.2) are within the root declarative region. Moreover, the root declarative region associated
with any given secondary unit is the root declarative region of the corresponding
primary unit.
There is also a library declarative region associated with each design library (see 13.2). Each library declarative region has within its scope declarations corresponding
to each primary unit contained within the associated design library.
NOTE An architecture body, though a declaration, does not occur immediately within any declarative region.