5.1 Simple and Compound Statements - Sequences of Statements
Syntax
Name Resolution Rules
Legality Rules
Static Semantics
Dynamic Semantics
A
transfer of control
is the run-time action of an
exit_statement,
return statement,
goto_statement,
or
requeue_statement,
selection of a
terminate_alternative,
raising of an exception, or an abort, which causes the next action performed
to be one other than what would normally be expected from the other rules
of the language. As explained in
7.6.1, a
transfer of control can cause the execution of constructs to be completed
and then left, which may trigger finalization.
Within a parallel construct, if a transfer of control
out of the construct is initiated by one of the logical threads of control,
an attempt is made to
cancel
all other logical threads of control initiated by the parallel construct.
Once all other logical threads of control of the construct either complete
or are canceled, the transfer of control occurs. If two or more logical
threads of control of the same construct initiate such a transfer of
control concurrently, one of them is chosen arbitrarily and the others
are canceled.
When a logical thread of control is canceled, the
cancellation causes it to complete as though it had performed a transfer
of control to the point where it would have finished its execution. Such
a cancellation is deferred while the logical thread of control is executing
within an abort-deferred operation (see
9.8),
and may be deferred further, but not past a point where the logical thread
initiates a new nested parallel construct or reaches an exception handler
that is outside such an abort-deferred operation.
Bounded (Run-Time) Errors
During the execution of a parallel
construct, it is a bounded error to invoke an operation that is potentially
blocking (see
9.5). Program_Error is raised
if the error is detected by the implementation; otherwise, the execution
of the potentially blocking operation can either proceed normally, or
it can result in the indefinite blocking of some or all of the logical
threads of control making up the current task.
NOTE A
statement_identifier
that appears immediately within the declarative region of a named
loop_statement
or an
accept_statement
is nevertheless implicitly declared immediately within the declarative
region of the innermost enclosing body or
block_statement;
in other words, the expanded name for a named statement is not affected
by whether the statement occurs inside or outside a named loop or an
accept_statement
— only nesting within
block_statements
is relevant to the form of its expanded name.
Examples
Examples of labeled
statements:
<<Here>> <<Ici>> <<Aqui>> <<Hier>> null;
<<After>> X := 1;
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe