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


5.6 Block Statements

(1)
A block_statement encloses a handled_sequence_of_statements optionally preceded by a declarative_part.
Syntax
(2)
       block_statement ::=
          [block_statement_identifier:]
              [declare
                   declarative_part]
               begin
                   handled_sequence_of_statements
               end [block_identifier];
(3)
Static Semantics
(4)
A block_statement that has no explicit declarative_part has an implicit empty declarative_part.
Dynamic Semantics
(5)
The execution of a block_statement consists of the elaboration of its declarative_part followed by the execution of its handled_sequence_of_statements.
Examples
(6)
Example of a block statement with a local variable:
(7)
       Swap:
          declare
             Temp : Integer;
          begin
             Temp := V; V := U; U := Temp;
          end Swap;


Prev | 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