Conversation
|
Unfortunately, it is not sufficient to represent a globally-scoped qualified name like I have revised the implementation to use a new Please review. |
Revised to check that qualified names of the form '$'::... are not parsed as globally-scoped qualified names.
|
@TheKorpos I have implemented this option on the ST6RI-830-1 branch. Please review, and, if you concur, I will move it to he ST6RI-830 branch. |
Oh yes, I forgot that '$'::A::B becomes $::A::B during qn conversion. Thank you for the fix.
This sounds like a pretty good idea and it is much simpler. Usually I'm a little bit worried using static fields like this. I have seen some nasty bugs where the same class was loaded multiple times in multi-threaded environments. I performed a smoke test in Eclipse and the instance is the same across threads so this is probably fine in our case. We'd also have to be careful how we (deep) copy qualified names and how we construct them moving forward. I think prefer the first version still. It is more explicit aobut this capability and feels more correct to me but if you really like the simpler solution I don't see any imminent issues with it. |
|
I decided to go with the simpler approach. However, I revised I have pushed the other approach (using |
Implement the resolution to the following issue, as approved in KerML FTF2 Ballot 5:
This resolution extends the qualified name notation in KerML and SysML to allow it to optionally have the global scope qualifier
$as its initial segment, as in$::A::B::C. Resolution of the remainder of such a qualified name then begins in global scope, rather than in the local scope in which the qualified name is parsed. This can be particularly useful for accessing a library package that would otherwise be hidden be a local package with the same name.For example, in the following model, the use of the global scope notation means that
Requirements::FunctionalRequirementCheckresolves to the appropriate element of the library packageRequirements, which would otherwise be hidden by the containingRequirementspackage.Changes
org.omg.kerml.expressions.xtextQualifiedNameproduction inKerMLExpressions.xtextto optionally allow a global scope qualification$::.org.omg.kerml.xtext.namingKerMLQualifiedNameConverterto handle globally-scoped qualified names.org.omg.kerml.xtext.scopingKerMLScopeandKerMLGlobalScopeto resolve globally-scoped qualified names.org.omg.sysml.utilElementUtil.parseQualifiedNameto handle global scope notation.