ObeoNetwork / POOSL

Eclipse Public License 2.0
1 stars 0 forks source link

Channel with 1 end is a legal syntax in cluster #70

Closed mypsycho closed 3 years ago

mypsycho commented 3 years ago

Usually connection have at least 2 ends. Currently single port is allowed:

Channel: {Channel}
    ( annotations+=Annotation )*
    '{' (
        ( instancePorts+=InstancePort (',' instancePorts+=InstancePort)*
            ( ','   externalPort=[Port|IDENTIFIER] (',' instancePorts+=InstancePort)*)? )
    |
        ( externalPort=[Port|IDENTIFIER] (',' instancePorts+=InstancePort)* )
    )? '}'
;

Should be (TBC) ?

Channel: {Channel}
    ( annotations+=Annotation )*
    '{' ( externalPort=[Port|IDENTIFIER] (',' instancePorts+=InstancePort)+ ) // external port first
        | ( instancePorts+=InstancePort                                       // external port then
                    (',' instancePorts+=InstancePort)* 
                    ',' externalPort=[Port|IDENTIFIER] 
                    (',' instancePorts+=InstancePort)* )
           | ( instancePorts+=InstancePort (',' instancePorts+=InstancePort)+ )   // no external port
         )  '}'
;
mypsycho commented 3 years ago

Low priority: There is not user-impact for well-formed models. It may even be for compliant with language definition.

mypsycho commented 3 years ago

This rule is implemented in custom validation rule. No design rationale is identified for such choices. There is no reason to fix this element prior any others in XText.