# Section 6.7:
Statements

Statements go to make up the body of all method implementations. They are of three fundamental kinds :-

- Guarded - those statements which execute conditionally upon some program state. These include variants such as if statements, protect statements, etc.
- Bounded - those statements which execute as a block, either sequentially as a statement sequence or concurrently as a set of threads of execution.
- Method Calls - those statements which are a call of either a pre-defined method (eg return, quit, raise) or a program defined method feature.

A variety of different syntactic forms are described in the following and the sub-sections defining each different kind. The abstract syntax is given in this sub-section only as far as the variants listed ablove. Further detail is given in the individual statement sub-sections.

#### Concrete Syntax

statement list = [statement], {Semicolon_SY, [statement]} ;

statement = | declaration statement
| | assign statement
| | if statement
| | return statement
| | case statement
| | typecase statement
| | expression statement
| | loop statement
| | yield statement
| | quit statement
| | protect statement
| | raise statement
| | assert statement
-- Iters
| | while statement
| | until statement
| | break statement
-- Concurrent programming
| | parallel statement
| | fork statement
| | parallel loop statement
| | select statement
| | lock statement
| | unlock statement
| | attach statement
| | synchronise statement
| | with near statement ;

#### Abstract Syntax

The Statement type has three principal abstract variant types defined in the following. Note in particular that all actions and state changes are carried out by a call statement of some kind.

Statement =
Guarded_Statement
| Bounded_Statement
| Call_Statement ;

NOTE | Method calls for statements are treated under method calls in Section 6.8.5 of this specification, the only difference in the semantics being the provision of a return value - or not.

#### Guarded_Statement

The Guarded statement comprises all variants of statement for which execution of some actions is conditional upon the result of evaluating some logical expression. Note that the 'lock' statement alternatives specified in Sather 1.1 have intentionally been separated into a Select statement and a Lock statement although their meaning has not changed.

Guarded_Statement =
Case_Statement
| Typecase_Statement
| Select_Statement
| Protect_Statement
| Lock_Statement
| Conditional_Statement ;

#### Bounded_Statement

Bounded statement variants all have the common property that a possible sequence of statements is delimited by markers which dictate how and where the statements are to be executed.

Bounded_Statement =
Loop_Statement
| Parallel_Statement
| Fork_Statement
| Location_Statement ;

#### Static Semantics

TO BE DONE

#### Dynamic Semantics

TO BE DONE

| Specification Index |  | Language Index |  | Section 6 Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Tuesday, 23 May 2000. |