Sather Home Page

Section 6.7:
Statements

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

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.
Produced with Amaya