____ | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


5.1 Simple and Compound Statements - Sequences of Statements

(1)
A statement is either simple or compound. A simple_statement encloses no other statement. A compound_statement can enclose simple_statements and other compound_statements.
Syntax
(2)
       sequence_of_statements ::= statement {statement}
(3)
       statement ::=
          {label} simple_statement | {label} compound_statement
(4)
       simple_statement ::= null_statement
          | assignment_statement              | exit_statement
          | goto_statement                    | procedure_call_statement
          | return_statement                  | entry_call_statement
          | requeue_statement                 | delay_statement
          | abort_statement                   | raise_statement
          | code_statement
(5)
       compound_statement ::=
            if_statement                      | case_statement
          | loop_statement                    | block_statement
          | accept_statement                  | select_statement
(6)
       null_statement ::= null;
(7)
       label ::= <<label_statement_identifier>>
(8)
       statement_identifier ::= direct_name
(9)
Name Resolution Rules
(10)
The direct_name of a statement_identifier shall resolve to denote its corresponding implicit declaration (see below).
Legality Rules
(11)
Distinct identifiers shall be used for all statement_identifiers that appear in the same body, including inner block_statements but excluding inner program units.
Static Semantics
(12)
For each statement_identifier, there is an implicit declaration (with the specified identifier) at the end of the declarative_part of the innermost block_statement or body that encloses the statement_identifier. The implicit declarations occur in the same order as the statement_identifiers occur in the source text. If a usage name denotes such an implicit declaration, the entity it denotes is the label, loop_statement, or block_statement with the given statement_identifier.
Dynamic Semantics
(13)
The execution of a null_statement has no effect.
(14)
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.
(15)
The execution of a sequence_of_statements consists of the execution of the individual statements in succession until the sequence_ is completed.

(16)
Examples
(17)
Examples of labeled statements:
(18)
       <<Here>> <<Ici>> <<Aqui>> <<Hier>> null;
(19)
       <<After>> X := 1;


____ | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12