5.8.2. Directed Formal Parameters

[Tip]Description

Directed formal parameters define the interface of a GT rule or an ASM rule by a list of ASM variables.

[Important]Syntax
	DirectedFormalParamsAST ::= DirectionKindAST VariableDefAST 
	                          | DirectedFormalParamsAST , DirectionKindAST VariableDefAST

	DirectionKindAST ::= in | out | inout

Directed formal parameters are defined by is a comma-separated list of variables (each having a direction specification). It can contain an arbitrary number of variables (including none). In contrast to the formal parameters, it defines a direction for each parameter, namely either in, out or inout.

[Note]Semantics

An input-only variable (with tag in) takes the value of the actual parameter, but at the end of the execution of the rule the value of the actual parameter is not updated.

An output-only variable(with tag out) does not take the value of the actual parameter: it is considered as undefined having the undefined value (undef). At the end of the execution of the rule, the value of the actual parameter is overwritten with the value of the variable defined as formal parameter.

An input-output variable(with tag inout) takes the value of the actual parameter, and at the end of the execution of the rule the value of the actual parameter is updated with the value of the variable defined as formal parameter.

Used By:  GT rule definition, ASM rule definition

See Also:  formal parameters, actual parameter, undefined value