Closed himi closed 7 months ago
I checked this PR with many test cases. For example,
package Case1 {
part p1 {
attribute a11;
}
part p2 :> p1 {
attribute a21 :>> a11 {
/* comment */
}
}
}
package Case2 {
part p1 {
attribute a11;
}
part p2 {
attribute a21 :>> p1.a11 {
/* comment */
}
}
}
package Case3 {
part p1 {
attribute a11;
}
part p2 :> p1 {
attribute a21 :>> p1.a11 {
/* comment */
}
attribute a22 = p1.a11;
}
}
The result in interconnection view looks like:
Even if we visualize, for example, Case1::p2::a21
only (the comment is for this purpose in Eclipse), we get:
This does not render a spurious redefinition.
This PR also uses FeatureUtil.getAllRedefinedFeaturesOf()
instead of iterating redefined features. It is important to deal with implicit elements. Therefore, we can properly handle
package TestRedefinedFeatures {
action a0 {
action a01 {
out output;
}
flow f1 from a01.output to a02.input;
action a02 {
in input;
}
}
action a1 :> a0 {
action :>> a02 {
in input;
}
}
}
The rendered result is:
Previously, we had to explicitly redefine a1.a02.input
to correctly render it.
The changes in PR #558 introduced a bug so that a redefinition whose target is missing may not be correctly rendered. For example,
and
%viz --view interconnection p2::p21
renders So far, redefinitions are handled with inherit key of redefined features, but that does not work well in some cases such as the above. This PR enhances PC (PathContext
) to properly handle redefinitions by differentiating the equivalence classes of redefinitions and non-redefinitions. By this enhancement, we can use the same inherit key with non-redefinition cases.