cross-subsetting-crossed-feature
Available in: KerML, SysML
This checks that CrossSubsettings always chain two features, and if declared
on one of two end features, starts from the opposite end feature.
Specification
The
crossed_featureof aCrossSubsettingmust have exactly twochaining_features. If thecrossing_featureof theCrossSubsettingis one of twoendFeatures, then the firstchaining_featuremust be the otherendFeature.
Examples
With one feature:
attribute def A;
attribute a {
end attribute b;
end attribute c : A => a; // error
}
With more than two features:
attribute def A;
attribute a {
end attribute b { attribute c { attribute d; } }
end attribute c : A => b.c.d; // error
}
Chaining through non-opposite feature:
attribute def A;
attribute a {
end attribute b;
end attribute c : A => a.b; // error
}
Instead, explicit crossings must start from the opposite end:
attribute def A;
attribute a {
end attribute b { attribute c : A; }
end attribute c : A => b.c; // ok
}