J.15 Aspect-related Pragmas
Pragmas can be used as an alternative to aspect_specifications
to specify certain aspects.
Name Resolution Rules
Certain
pragmas
are defined to be
program unit pragmas.
A
name given
as the argument of a program unit pragma shall resolve to denote the
declarations or renamings of one or more program units that occur immediately
within the declarative region or
compilation
in which the
pragma
immediately occurs, or it shall resolve to denote the declaration of
the immediately enclosing program unit (if any); the
pragma
applies to the denoted program unit(s). If there are no
names
given as arguments, the
pragma
applies to the immediately enclosing program unit.
Legality Rules
A program unit pragma
shall appear in one of these places:
Immediately within the visible part of a program
unit and before any nested declaration (but not within a generic formal
part), in which case the argument, if any, shall be a
direct_name
that denotes the immediately enclosing program unit declaration.
Certain
program unit pragmas are defined to be
library unit pragmas. If
a library unit pragma applies to a program unit, the program unit shall
be a library unit.
Static Semantics
A library unit pragma that applies to a generic unit
does not apply to its instances, unless a specific rule for the pragma
specifies the contrary.
Implementation Advice
When applied to a generic unit, a program unit pragma
that is not a library unit pragma should apply to each instance of the
generic unit for which there is not an overriding pragma applied directly
to the instance.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe