1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>AARM95 - Declarations</TITLE>
<META NAME="Author" CONTENT="JTC1/SC22/WG9/ARG, by Randall Brukardt, ARG Editor">
<META NAME="GENERATOR" CONTENT="Arm_Form.Exe, Ada Reference Manual generator">
<STYLE type="text/css">
DIV.paranum {position: absolute; font-family: Arial, Helvetica, sans-serif; left: 0.5 em; top: auto}
TT {font-family: "Courier New", monospace}
DT {display: compact}
DIV.Normal {font-family: "Times New Roman", Times, serif; margin-bottom: 0.6em}
DIV.Wide {font-family: "Times New Roman", Times, serif; margin-top: 0.6em; margin-bottom: 0.6em}
DIV.Annotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
DIV.WideAnnotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0.6em; margin-bottom: 0.6em}
DIV.Index {font-family: "Times New Roman", Times, serif}
DIV.SyntaxSummary {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
DIV.Notes {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.6em}
DIV.NotesHeader {font-family: "Times New Roman", Times, serif; margin-left: 2.0em}
DIV.SyntaxIndented {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
DIV.Indented {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-bottom: 0.6em}
DIV.CodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
DIV.SmallIndented {font-family: "Times New Roman", Times, serif; margin-left: 10.0em; margin-bottom: 0.6em}
DIV.SmallCodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-bottom: 0.6em}
DIV.Examples {font-family: "Courier New", monospace; margin-left: 2.0em; margin-bottom: 0.6em}
DIV.SmallExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left: 7.5em; margin-bottom: 0.6em}
DIV.IndentedExamples {font-family: "Courier New", monospace; margin-left: 8.0em; margin-bottom: 0.6em}
DIV.SmallIndentedExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left: 15.0em; margin-bottom: 0.6em}
UL.Bulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.SmallBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.NestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.SmallNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.IndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.CodeIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.CodeIndentedNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.SyntaxIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.NotesBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
UL.NotesNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
DL.Hanging {font-family: "Times New Roman", Times, serif; margin-top: 0em; margin-bottom: 0.6em}
DD.Hanging {margin-left: 6.0em}
DL.IndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
DD.IndentedHanging {margin-left: 2.0em}
DL.HangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
DD.HangingInBulleted {margin-left: 4.0em}
DL.SmallHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
DD.SmallHanging {margin-left: 7.5em}
DL.SmallIndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-top: 0em; margin-bottom: 0.6em}
DD.SmallIndentedHanging {margin-left: 2.0em}
DL.SmallHangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
DD.SmallHangingInBulleted {margin-left: 5.0em}
DL.Enumerated {font-family: "Times New Roman", Times, serif; margin-right: 0.0em; margin-top: 0em; margin-bottom: 0.5em}
DD.Enumerated {margin-left: 2.0em}
DL.SmallEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
DD.SmallEnumerated {margin-left: 2.5em}
DL.NestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
DL.SmallNestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
</STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFF0" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<P><A HREF="AA-TOC.html">Contents</A> <A HREF="AA-0-29.html">Index</A> <A HREF="AA-3.html">Previous</A> <A HREF="AA-3-2.html">Next</A></P>
<HR>
<H1> 3.1 Declarations</H1>
<DIV Class="Paranum"><FONT SIZE=-2>1</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1294"></A>The language defines several
kinds of named <I>entities</I> that are declared by declarations. <A NAME="I1295"></A>The
entity's <I>name</I> is defined by the declaration, usually by a <FONT FACE="Arial, Helvetica">defining_identifier</FONT>,
but sometimes by a <FONT FACE="Arial, Helvetica">defining_character_literal</FONT>
or <FONT FACE="Arial, Helvetica">defining_operator_symbol</FONT>.</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>2</FONT></DIV>
<DIV Class="Normal"> There are several forms of declaration. A <FONT FACE="Arial, Helvetica">basic_declaration</FONT>
is a form of declaration defined as follows. </DIV>
<H4 ALIGN=CENTER>Syntax</H4>
<DIV Class="Paranum"><FONT SIZE=-2>3</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">basic_declaration<A NAME="I1296"></A>
::= </FONT><BR>
<A NAME="I1297"></A><FONT FACE="Arial, Helvetica">type_declaration</FONT> | <A NAME="I1298"></A><FONT FACE="Arial, Helvetica">subtype_declaration</FONT><BR>
| <A NAME="I1299"></A><FONT FACE="Arial, Helvetica">object_declaration</FONT> | <A NAME="I1300"></A><FONT FACE="Arial, Helvetica">number_declaration</FONT><BR>
| <A NAME="I1301"></A><FONT FACE="Arial, Helvetica">subprogram_declaration</FONT> | <A NAME="I1302"></A><FONT FACE="Arial, Helvetica">abstract_subprogram_declaration</FONT><BR>
| <A NAME="I1303"></A><FONT FACE="Arial, Helvetica">package_declaration</FONT> | <A NAME="I1304"></A><FONT FACE="Arial, Helvetica">renaming_declaration</FONT><BR>
| <A NAME="I1305"></A><FONT FACE="Arial, Helvetica">exception_declaration</FONT> | <A NAME="I1306"></A><FONT FACE="Arial, Helvetica">generic_declaration</FONT><BR>
| <A NAME="I1307"></A><FONT FACE="Arial, Helvetica">generic_instantiation</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">defining_identifier<A NAME="I1308"></A>
::= </FONT><A NAME="I1309"></A><FONT FACE="Arial, Helvetica">identifier</FONT></DIV>
<H4 ALIGN=CENTER>Static Semantics</H4>
<DIV Class="Paranum"><FONT SIZE=-2>5</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1310"></A>A <I>declaration</I> is a
language construct that associates a name with (a view of) an entity.
<A NAME="I1311"></A><A NAME="I1312"></A>A declaration may appear explicitly
in the program text (an <I>explicit</I> declaration), or may be supposed
to occur at a given place in the text as a consequence of the semantics
of another construct (an <I>implicit</I> declaration). </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>An implicit
declaration generally declares a predefined or inherited operation associated
with the definition of a type. This term is used primarily when allowing
explicit declarations to override implicit declarations, as part of a
type declaration. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1313"></A>Each of the following is defined
to be a declaration: any <FONT FACE="Arial, Helvetica">basic_declaration</FONT>;
an <FONT FACE="Arial, Helvetica">enumeration_literal_specification</FONT>;
a <FONT FACE="Arial, Helvetica">discriminant_specification</FONT>; a
<FONT FACE="Arial, Helvetica">component_declaration</FONT>; a <FONT FACE="Arial, Helvetica">loop_parameter_specification</FONT>;
a <FONT FACE="Arial, Helvetica">parameter_specification</FONT>; a <FONT FACE="Arial, Helvetica">subprogram_body</FONT>;
an <FONT FACE="Arial, Helvetica">entry_declaration</FONT>; an <FONT FACE="Arial, Helvetica">entry_index_specification</FONT>;
a <FONT FACE="Arial, Helvetica">choice_parameter_specification</FONT>;
a <FONT FACE="Arial, Helvetica">generic_formal_parameter_declaration</FONT>.
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>This list (when
<FONT FACE="Arial, Helvetica">basic_declaration</FONT> is expanded out)
contains all syntactic categories that end in "_declaration"
or "_specification", except for program unit _specifications.
Moreover, it contains <FONT FACE="Arial, Helvetica">subprogram_body</FONT>.
A <FONT FACE="Arial, Helvetica">subprogram_body</FONT> is a declaration,
whether or not it completes a previous declaration. This is a bit strange,
<FONT FACE="Arial, Helvetica">subprogram_body</FONT> is not part of the
syntax of <FONT FACE="Arial, Helvetica">basic_declaration</FONT> or <FONT FACE="Arial, Helvetica">library_unit_declaration</FONT>.
A renaming-as-body is considered a declaration. An <FONT FACE="Arial, Helvetica">accept_statement</FONT>
is not considered a declaration. Completions are sometimes declarations,
and sometimes not. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1314"></A><A NAME="I1315"></A>All declarations
contain a <I>definition</I> for a <I>view</I> of an entity. A view consists
of an identification of the entity (the entity <I>of</I> the view), plus
view-specific characteristics that affect the use of the entity through
that view (such as mode of access to an object, formal parameter names
and defaults for a subprogram, or visibility to components of a type).
In most cases, a declaration also contains the definition for the entity
itself (a <FONT FACE="Arial, Helvetica">renaming_declaration</FONT> is
an example of a declaration that does not define a new entity, but instead
defines a view of an existing entity (see <A HREF="AA-8-5.html">8.5</A>)).
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Glossary entry: </B>(See <B>Definition</B>.)</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Most declarations
define a view (of some entity) whose view-specific characteristics are
unchanging for the life of the view. However, subtypes are somewhat unusual
in that they inherit characteristics from whatever view of their type
is currently visible. Hence, a subtype is not a <I>view</I> of a type;
it is more of an indirect reference. By contrast, a private type provides
a single, unchanging (partial) view of its full type. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>8</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1316"></A>For each declaration, the
language rules define a certain region of text called the <I>scope</I>
of the declaration (see <A HREF="AA-8-2.html">8.2</A>). Most declarations
associate an <FONT FACE="Arial, Helvetica">identifier</FONT> with a declared
entity. Within its scope, and only there, there are places where it is
possible to use the <FONT FACE="Arial, Helvetica">identifier</FONT> to
refer to the declaration, the view it defines, and the associated entity;
these places are defined by the visibility rules (see <A HREF="AA-8-3.html">8.3</A>).
<A NAME="I1317"></A>At such places the <FONT FACE="Arial, Helvetica">identifier</FONT>
is said to be a <I>name</I> of the entity (the <FONT FACE="Arial, Helvetica">direct_name</FONT>
or <FONT FACE="Arial, Helvetica">selector_name</FONT>); <A NAME="I1318"></A>the
name is said to <I>denote</I> the declaration, the view, and the associated
entity (see <A HREF="AA-8-6.html">8.6</A>). <A NAME="I1319"></A>The declaration
is said to <I>declare</I> the name, the view, and in most cases, the
entity itself.</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9</FONT></DIV>
<DIV Class="Normal"> As an alternative to an <FONT FACE="Arial, Helvetica">identifier</FONT>,
an enumeration literal can be declared with a <FONT FACE="Arial, Helvetica">character_literal</FONT>
as its name (see <A HREF="AA-3-5-1.html">3.5.1</A>), and a function can
be declared with an <FONT FACE="Arial, Helvetica">operator_symbol</FONT>
as its name (see <A HREF="AA-6-1.html">6.1</A>).</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1320"></A>The syntax rules use the
terms <FONT FACE="Arial, Helvetica">defining_identifier</FONT>, <FONT FACE="Arial, Helvetica">defining_character_literal</FONT>,
and <FONT FACE="Arial, Helvetica">defining_operator_symbol</FONT> for
the defining occurrence of a name; these are collectively called <I>defining
names</I>. <A NAME="I1321"></A>The terms <FONT FACE="Arial, Helvetica">direct_name</FONT>
and <FONT FACE="Arial, Helvetica">selector_name</FONT> are used for usage
occurrences of <FONT FACE="Arial, Helvetica">identifier</FONT>s, <FONT FACE="Arial, Helvetica">character_literal</FONT>s,
and <FONT FACE="Arial, Helvetica">operator_symbol</FONT>s. These are
collectively called <I>usage names</I>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B>The terms
<FONT FACE="Arial, Helvetica">identifier</FONT>, <FONT FACE="Arial, Helvetica">character_literal</FONT>,
and <FONT FACE="Arial, Helvetica">operator_symbol</FONT> are used directly
in contexts where the normal visibility rules do not apply (such as the
<FONT FACE="Arial, Helvetica">identifier</FONT> that appears after the
<B>end</B> of a <FONT FACE="Arial, Helvetica">task_body</FONT>). Analogous
conventions apply to the use of <FONT FACE="Arial, Helvetica">designator</FONT>,
which is the collective term for <FONT FACE="Arial, Helvetica">identifier</FONT>
and <FONT FACE="Arial, Helvetica">operator_symbol</FONT>. </FONT></DIV>
<H4 ALIGN=CENTER>Dynamic Semantics</H4>
<DIV Class="Paranum"><FONT SIZE=-2>11</FONT></DIV>
<DIV Class="Normal"> <A NAME="I1322"></A>The process by which a construct
achieves its run-time effect is called <I>execution</I>. <A NAME="I1323"></A><A NAME="I1324"></A>This
process is also called <I>elaboration</I> for declarations and <I>evaluation</I>
for expressions. One of the terms execution, elaboration, or evaluation
is defined by this International Standard for each construct that has
a run-time effect. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Glossary entry: </B>The process
by which a construct achieves its run-time effect is called <I>execution</I>.
<A NAME="I1325"></A><A NAME="I1326"></A>Execution of a declaration is
also called <I>elaboration</I>. Execution of an expression is also called
<I>evaluation</I>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B>The term
elaboration is also used for the execution of certain constructs that
are not declarations, and the term evaluation is used for the execution
of certain constructs that are not expressions. For example, <FONT FACE="Arial, Helvetica">subtype_indication</FONT>s
are elaborated, and <FONT FACE="Arial, Helvetica">range</FONT>s are evaluated.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>For bodies, execution and elaboration
are both explicitly defined. When we refer specifically to the execution
of a body, we mean the explicit definition of execution for that kind
of body, not its elaboration. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Technically,
"the execution of a declaration" and "the elaboration
of a declaration" are synonymous. We use the term "elaboration"
of a construct when we know the construct is elaborable. When we are
talking about more arbitrary constructs, we use the term "execution".
For example, we use the term "erroneous execution", to refer
to any erroneous execution, including erroneous elaboration or evaluation.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.e</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>When we explicitly define evaluation
or elaboration for a construct, we are implicitly defining execution
of that construct.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.f</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We also use the term "execution"
for things like <FONT FACE="Arial, Helvetica">statement</FONT>s, which
are executable, but neither elaborable nor evaluable. We considered using
the term "execution" only for non-elaborable, non-evaluable
constructs, and defining the term "action" to mean what we
have defined "execution" to mean. We rejected this idea because
we thought three terms that mean the same thing was enough -- four would
be overkill. Thus, the term "action" is used only informally
in the standard (except where it is defined as part of a larger term,
such as "protected action"). </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.g</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B><A NAME="I1327"></A>A
construct is <I>elaborable</I> if elaboration is defined for it. <A NAME="I1328"></A>A
construct is <I>evaluable</I> if evaluation is defined for it. <A NAME="I1329"></A>A
construct is <I>executable</I> if execution is defined for it. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.h</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Don't confuse
``elaborable'' with ``preelaborable'' (defined in <A HREF="AA-10-2-1.html">10.2.1</A>).</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.i</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Evaluation of an evaluable construct
produces a result that is either a value, a denotation, or a range. The
following are evaluable: expression; <FONT FACE="Arial, Helvetica">name</FONT>
<FONT FACE="Arial, Helvetica">prefix</FONT>; <FONT FACE="Arial, Helvetica">range</FONT>;
<FONT FACE="Arial, Helvetica">entry_list_iterator</FONT>; and possibly
<FONT FACE="Arial, Helvetica">discrete_range</FONT>. The last one is
curious -- RM83 uses the term ``evaluation of a <FONT FACE="Arial, Helvetica">discrete_range</FONT>,''
but never defines it. One might presume that the evaluation of a <FONT FACE="Arial, Helvetica">discrete_range</FONT>
consists of the evaluation of the <FONT FACE="Arial, Helvetica">range</FONT>
or the <FONT FACE="Arial, Helvetica">subtype_indication</FONT>, depending
on what it is. But <FONT FACE="Arial, Helvetica">subtype_indication</FONT>s
are not evaluated; they are elaborated.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.j</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Intuitively, an <I>executable</I>
construct is one that has a defined run-time effect (which may be null).
Since execution includes elaboration and evaluation as special cases,
all elaborable and all evaluable constructs are also executable. Hence,
most constructs in Ada are executable. An important exception is that
the constructs inside a generic unit are not executable directly, but
rather are used as a template for (generally) executable constructs in
instances of the generic. </FONT></DIV>
<DIV Class="NotesHeader"><FONT SIZE=-1>NOTES</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12</FONT></DIV>
<DIV Class="Notes"><FONT SIZE=-1>1 <A NAME="I1330"></A>At
compile time, the declaration of an entity <I>declares</I> the entity.
<A NAME="I1331"></A>At run time, the elaboration of the declaration <I>creates</I>
the entity. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>Syntactic
categories for declarations are named either <I>entity_</I><FONT FACE="Arial, Helvetica">declaration</FONT>
(if they include a trailing semicolon) or <I>entity_</I><FONT FACE="Arial, Helvetica">specification</FONT>
(if not).</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><A NAME="I1332"></A>The various
kinds of named entities that can be declared are as follows: an object
(including components and parameters), a named number, a type (the name
always refers to its first subtype), a subtype, a subprogram (including
enumeration literals and operators), a single entry, an entry family,
a package, a protected or task unit (which corresponds to either a type
or a single object), an exception, a generic unit, a label, and the name
of a statement.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Identifiers are also associated
with names of pragmas, arguments to pragmas, and with attributes, but
these are not user-definable. </FONT></DIV>
<H4 ALIGN=CENTER>Wording Changes from Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>12.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The syntax rule for <FONT FACE="Arial, Helvetica">defining_identifier</FONT>
is new. It is used for the defining occurrence of an <FONT FACE="Arial, Helvetica">identifier</FONT>.
Usage occurrences use the <FONT FACE="Arial, Helvetica">direct_name</FONT>
or <FONT FACE="Arial, Helvetica">selector_name</FONT> syntactic categories.
Each occurrence of an <FONT FACE="Arial, Helvetica">identifier</FONT>
(or <FONT FACE="Arial, Helvetica">simple_name</FONT>), <FONT FACE="Arial, Helvetica">character_literal</FONT>,
or <FONT FACE="Arial, Helvetica">operator_symbol</FONT> in the Ada 83
syntax rules is handled as follows in Ada 95: </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.e</FONT></DIV>
<UL Class="SmallBulleted" Style="margin-bottom: 0.3em"><FONT SIZE=-1><LI TYPE=DISC>It becomes a <FONT FACE="Arial, Helvetica">defining_identifier</FONT>,
<FONT FACE="Arial, Helvetica">defining_character_literal</FONT>, or <FONT FACE="Arial, Helvetica">defining_operator_symbol</FONT>
(or some syntactic category composed of these), to indicate a defining
occurrence;</LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12.f</FONT></DIV>
<UL Class="SmallBulleted"><FONT SIZE=-1><LI TYPE=DISC>It becomes a <FONT FACE="Arial, Helvetica">direct_name</FONT>,
in usage occurrences where the usage is required (in Section 8) to be
directly visible;</LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12.g</FONT></DIV>
<UL Class="SmallBulleted"><FONT SIZE=-1><LI TYPE=DISC>It becomes a <FONT FACE="Arial, Helvetica">selector_name</FONT>,
in usage occurrences where the usage is required (in Section 8) to be
visible but not necessarily directly visible;</LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12.h</FONT></DIV>
<UL Class="SmallBulleted"><FONT SIZE=-1><LI TYPE=DISC>It remains an <FONT FACE="Arial, Helvetica">identifier</FONT>,
<FONT FACE="Arial, Helvetica">character_literal</FONT>, or <FONT FACE="Arial, Helvetica">operator_symbol</FONT>,
in cases where the visibility rules do not apply (such as the <FONT FACE="Arial, Helvetica">designator</FONT>
that appears after the <B>end</B> of a <FONT FACE="Arial, Helvetica">subprogram_body</FONT>).
</LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>12.i</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>For declarations that come in
``two parts'' (program unit declaration plus body, private or incomplete
type plus full type, deferred constant plus full constant), we consider
both to be defining occurrences. Thus, for example, the syntax for <FONT FACE="Arial, Helvetica">package_body</FONT>
uses <FONT FACE="Arial, Helvetica">defining_identifier</FONT> after the
reserved word <B>body</B>, as opposed to <FONT FACE="Arial, Helvetica">direct_name</FONT>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.j</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The defining occurrence of a statement
name is in its implicit declaration, not where it appears in the program
text. Considering the statement name itself to be the defining occurrence
would complicate the visibility rules.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.k</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The phrase ``visible by selection''
is not used in Ada 95. It is subsumed by simply ``visible'' and the Name
Resolution Rules for <FONT FACE="Arial, Helvetica">selector_name</FONT>s.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.l</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>(Note that in Ada 95, a declaration
is visible at all places where one could have used a <FONT FACE="Arial, Helvetica">selector_name</FONT>,
not just at places where a <FONT FACE="Arial, Helvetica">selector_name</FONT>
was actually used. Thus, the places where a declaration is directly visible
are a subset of the places where it is visible. See Section 8 for details.)</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.m</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We use the term ``declaration''
to cover <FONT FACE="Arial, Helvetica">_specification</FONT>s that declare
(views of) objects, such as <FONT FACE="Arial, Helvetica">parameter_specification</FONT>s.
In Ada 83, these are referred to as a ``form of declaration,'' but it
is not entirely clear that they are considered simply ``declarations.''</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.n</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>RM83 contains an incomplete definition
of "elaborated" in this clause: it defines "elaborated"
for declarations, <FONT FACE="Arial, Helvetica">declarative_part</FONT>s,
<FONT FACE="Arial, Helvetica">declarative_item</FONT>s and <FONT FACE="Arial, Helvetica">compilation_unit</FONT>s,
but "elaboration" is defined elsewhere for various other constructs.
To make matters worse, Ada 95 has a different set of elaborable constructs.
Instead of correcting the list, it is more maintainable to refer to the
term "elaborable," which is defined in a distributed manner.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.o</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>RM83 uses the term ``has no other
effect'' to describe an elaboration that doesn't do anything except change
the state from not-yet-elaborated to elaborated. This was a confusing
wording, because the answer to ``other than what?'' was to be found many
pages away. In Ada 95, we change this wording to ``has no effect'' (for
things that truly do nothing at run time), and ``has no effect other
than to establish that so-and-so can happen without failing the Elaboration_Check''
(for things where it matters).</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12.p</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We make it clearer that the term
"execution" covers elaboration and evaluation as special cases.
This was implied in RM83. For example, "erroneous execution"
can include any execution, and RM83-9.4(3) has, "The task designated
by any other task object depends on the master whose execution creates
the task object;" the elaboration of the master's <FONT FACE="Arial, Helvetica">declarative_part</FONT>
is doing the task creation. </FONT></DIV>
<HR>
<P><A HREF="AA-TOC.html">Contents</A> <A HREF="AA-0-29.html">Index</A> <A HREF="AA-3.html">Previous</A> <A HREF="AA-3-2.html">Next</A> <A HREF="AA-TTL.html">Legal</A></P>
</BODY>
</HTML>
|