| Table of |
| §A. ObjectTeams/Java Syntax |
Notation
...).
§A.0. Keywords
The keywords introduced by OT/J have different scopes, which means outside their given scope these keywords can be used for regular identifiers. Only these names are keywords unconditionally:
§A.0.1. Scoped keywords
The following names are keywords in OT/J only if they appear within a team or role class, ie., after the keyword team has been recognized:§A.0.2. Inheriting scoped keywords
While regular Java classes may use the scoped keywords (§A.0.1) of OT/J freely, it is an error if a role class inherits a feature whose name is a scoped keyword.§A.1. Class definitions
Class definitions add two new keywords team and
playedBy. Classes which use these keywords are called
teams and bound roles, respectively.
Any class that inherits from a bound role class (either by an
extends clause or by implicit inheritance, cf.
§ 1.3.1(c)) is again a bound role class.
| § A.1.1 | ClassDeclaration: [Modifiers][team] class Identifier [extends Type] [implements TypeList][playedBy Type] [Guard]ClassBody
|
Contextual constraints:
(a) A class which has a playedBy clause (a bound
role class) may not be declared static and
must be directly contained in a class that has the
team modifier (a team class).
(b) A class which inherits from a team class must have the
team modifier, too.
(c) A class which has a guard (see § 5.4) must be a team or a role.
§A.2. Modifiers
The rule for method modifiers adds one keyword: callin:
Contextual constraints:
(a) The class of a method which has the callin modifier
may not be declared static and must be directly contained in a team class.
(b) A method that has the callin modifier may not
appear in an explicit method call (rule Apply in JLS).
§A.3. Method bindings
The rule of items declarable in a class body is augmented by method bindings:
| § A.3.2 | CalloutBinding: MethodSpec CalloutKind MethodSpec CalloutParameterMappings
MethodSpec CalloutKind CalloutModifier FieldSpec
|
| § A.3.3 | Callin binding: [ Identifier : ] MethodSpec <- CallinModifier MethodSpecs [Guard] CallinParameterMappings
|
Contextual constraints:
(a) CalloutBindings and CallinBindings
may occur only in bound role classes.
(b) A CalloutBinding or CallinBinding
may not mix identifiers and
full signatures (MethodDeclarationHead) for its method
specifiers (MethodSpec).
Binding a full method signature to a field requires the FieldSpec
to include the Type.
(c) The method specifier at the left hand side of a
CallinBinding which has the replace modifier
must refer to a method that has the callin modifier.
§A.5. Statements
Contextual constraints:
(a) The expression of a Within must evaluate
to an instance of a team class.
(b) The first form of a BaseCall may occur only
in the body of a method that has the callin modifier.
The identifier must be the name of the enclosing method.
(c)
The second form of a BaseCall may occur only in a constructor of a
bound role class.
(d)
The first form of a TSuperCall may occur only in a method of
a role class.
(e)
The second form of a TSuperCall may occur only in a constructor of a
role class.
§A.6. Types
LiftingType may only occur in the parameter list of a method of a team class.
LiftingType must be a class directly contained in the enclosing team class (the class may be acquired by implicit inheritance).
AnchoredType must refer to an instance of a team class. Each identifier in the path must be declared with the final modifier.
§A.7. Guard predicates
Guard: §A.1.1 ClassDeclaration,
§A.3.3 CallinBindingContextual constraints:(a) The
Expression in a guard must have type boolean§A.9. Value dependent types
ActualTypeArgument of the form @Name only occur as a parameter of a simple name type reference.
| Table of |
