VDM-10 Language Manual
VDM-10 Language Manual
VDM-10 Language Manual
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>VDM</strong>-<strong>10</strong> <strong>Language</strong> <strong>Manual</strong><br />
For <strong>VDM</strong>-SL call statements are defined as:<br />
call statement = name, ‘(’, [ expression list ], ‘)’ ;<br />
For <strong>VDM</strong>++ and <strong>VDM</strong>-RT call statements are defined as:<br />
call statement = [ object designator, ‘.’ ], name,<br />
‘(’, [ expression list ], ‘)’, ;<br />
object designator = name<br />
| self expression<br />
| new expression<br />
| object field reference<br />
| object apply ;<br />
object field reference = object designator, ‘.’, identifier ;<br />
object apply = object designator, ‘(’, [ expression list ], ‘)’ ;<br />
Semantics: In <strong>VDM</strong>-SL the call statement has the form:<br />
✞<br />
opname(param1, param2, ..., paramn)<br />
✡✝<br />
In <strong>VDM</strong>++ and <strong>VDM</strong>-RT the call statement has the form:<br />
✞<br />
object.opname(param1, param2, ..., paramn)<br />
✡✝<br />
✆<br />
✆<br />
The call statement calls an operation, opname, (in a <strong>VDM</strong>++ and <strong>VDM</strong>-RT context in an<br />
object, object), and returns the result of evaluating the operation. Because operations can<br />
manipulate global variables a call statement does not necessarily have to return a value as<br />
function calls do.<br />
In <strong>VDM</strong>++ and <strong>VDM</strong>-RT if an object designator is specified it must yield an object reference<br />
to an object of a class in which the operation opname is defined, and then the operation<br />
must be specified as public. If no object designator is specified the operation will<br />
be called in the current object. If the operation is defined in a superclass, it must have been<br />
defined as public or protected.<br />
Examples: In <strong>VDM</strong>-SL the operation ResetStack given below does not have any parameter<br />
and does not return a value whereas the operation PopStack returns the top element of the<br />
stack.<br />
112