[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes extensions to JML to support the MultiJava [Clifton-etal00] language. All of these extensions are optional and are only used when an option (or special tool) is used to parse this syntax.
The sections below explain the extensions that MultiJava makes to JML.
17.1 Augmenting Method Declarations 17.2 MultiMethods
MultiJava has a feature, called "open classes" [Clifton-etal00] or "augmenting methods" that allows methods to be added to an existing class. It has the following syntax, which, in JML, permits method specifications.
multijava-top-level-declaration ::= multijava-top-level-method multijava-top-level-method ::= [ method-specification ] modifiers [ |
This syntax adds a method to the class named by the name in the extending-method-head.
The method must satisfy the given method-specification, if there is one.
The other feature in MultiJava is multiple dispatch, which is used to define multimethods. Multiple dispatch is defined using the following syntax.
multijava-param-declaration ::= [ param-modifier ] ... type-spec specializer ident [ dims ] specializer ::= |
See the MultiJava paper [Clifton-etal00] for how the use of a specializer affects the meaning of method calls.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |