-
Key: KERML-24
-
Status: closed
-
Source: Model Driven Solutions ( Mr. Ed Seidewitz)
-
Summary:
The second line of the following does not parse:
abstract connector c1; abstract connector c2 = c3; // Error: No viable alternative at input '='
The reason for this is that the NaryConnectorDeclaration production uses FeatureDeclaration (see KerML 8.2.5.5.1):
NaryConnectorDeclaration : Connector = FeatureDeclaration ( '(' ownedRelationship += ConnectorEndMember ',' ownedRelationship += ConnectorEndMember ( ',' ownedRelationship += ConnectorEndMember )* ')' )?
However, however FeatureDeclaration does not include ValuePart, which provides the syntax for feature values (see KerML 8.2.4.3):
Feature = FeaturePrefix ( 'feature'? FeatureDeclaration | 'feature' | ownedRelationship += PrefixMetadataMember ) ValuePart? TypeBody
On the other hand, KerML 7.4.6.2 states that “A connector is declared as a feature (see 7.3.4.2) using the keyword connector”, and a feature declaration (in the informal sense) can, in general, include a feature value, so it would be expected to be allowable for a connector, too.
Note that this is not a problem for item flows, which explicitly allows a ValuePart (KerML 8.2.5.9.2):
ItemFlowDeclaration : ItemFlow = ( FeatureDeclaration ValuePart? ( 'of' ownedRelationship += ItemFeatureMember )? ( 'from' ownedRelationship += ItemFlowEndMember 'to' ownedRelationship += ItemFlowEndMember )? | ( isSufficient ?= 'all' )? ownedRelationship += ItemFlowEndMember 'to' ownedRelationship += ItemFlowEndMember
-
Reported: KerML 1.0a1 — Fri, 21 Apr 2023 22:53 GMT
-
Disposition: Resolved — KerML 1.0b2
-
Disposition Summary:
Correct textual notation for Connectors
It would clearly be desirable to include ValuePart in the connector notation. However, introducing ValuePart into the NaryConnectorDeclartion notation after FeatureDeclaration causes an ambiguity in the grammar with an InvocationExpression in the ValuePart. For example, it would not longer be possible to syntactically distinguish whether connector c = f(a,b); is to be parsed as an connector bound to the InvocationExpression f(a,b), or as an n-ary connector bound to the FeatureReferenceExpression f and having related features a and b.
While it would be possible to allow a ValuePart in the binary connector notation, it seems more consistent to allow it only when not using either of the special binary or n-ary connector notations. Note that this is only a notational limitation, not a functional one, since end members can always be specified in the connector body. And it also seems likely that a feature value will be used with a connector mostly when no related features are specified, anyway.
-
Updated: Tue, 1 Jul 2025 15:01 GMT
KERML — Connector declaration does not allow a feature value
- Key: KERML-24
- OMG Task Force: Kernel Modeling Language (KerML) 1.0 FTF