# Section 6.8.5:
Method Calls

In order to effect actions and state changes, the Sather language uses method (routines and iters) calls. Those which return a value are therefore expressions, those which do not are statements. Both forms of call are specified in this sub-section of the language definition because of the commonality of their abstract model.

#### Concrete Syntax

call expression = routine call | iter call ;

#### Abstract Syntax

The call statement comprises all of the statement variants which carry out the actions of a program.

Call_Statement =
Assign_Call
| Application_Statement

in which the assignment call is treated specially. There are two variants of application statement - one pre-defined by the language and the other user written.

Application_Statement =
| Predefined_Call
| Feature_Application ;

The expression evaluation calls are analogous to the Application_Statement above, thus -

Eval_Expression =
Predefined_Call
| Feature_Application ;

##### Predefined Calls

The similarity between prredefined call statements and predefined call expressions extends to them having the same abstract syntax - with different invariants, thus for the statement variant -

Predefined_Call ::
id : token
args : Feature
impl : Feature
rval : [Value_Expression] ;
inv mk_Predefined_Call(expid,_,_,val) ==
expid in set dom Built_In_Name
and val = nil

and for the expression variant -

Predefined_Call ::
id : token
args : Feature
impl : Feature
rval : [ Value_Expression] ;
inv mk_Predefined_Call(expid,_,_,val) ==
expid in set dom Built_In_Exp_Name
and val <> nil

##### Feature_Application

Feature application is again common to both expression and statement, the only restriction occurring in the well-formedness function in relation to returned value (or not).

Feature_Application ::
id : Defined_Feature_Name
body : Feature ;

#### 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: Monday, 29 May 2000. |