25.07.2014 Views

VDM-10 Language Manual

VDM-10 Language Manual

VDM-10 Language Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 12<br />

Operation Definitions<br />

Operations have already been mentioned in section 4. The general form is described here and<br />

for <strong>VDM</strong>++ and <strong>VDM</strong>-RT special operations called constructors which are used for constructing<br />

instances of a class are described in section 12.1. Note that the async keyword can only be used<br />

in the <strong>VDM</strong>-RT dialect.<br />

Syntax: operation definitions = ‘operations’, [ access operation definition ],<br />

{ ‘;’, access operation definition } ;<br />

, [ ‘;’ ]<br />

access operation definition = ( [ ‘async’ ] [ access ], [ ‘static’ ])<br />

| ( [ ‘async’ ] [ ‘static’ ], [ access ]),<br />

operation definition ;<br />

operation definition = explicit operation definition<br />

| implicit operation definition<br />

| extended explicit operation definition ;<br />

explicit operation definition =<br />

implicit operation definition =<br />

identifier, ‘:’, operation type,<br />

identifier, parameters,<br />

‘==’,<br />

operation body,<br />

[ ‘pre’, expression ],<br />

[ ‘post’, expression ] ;<br />

identifier, parameter types,<br />

[ identifier type pair list ],<br />

implicit operation body ;<br />

implicit operation body = [ externals ],<br />

[ ‘pre’, expression ],<br />

89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!