-
Notifications
You must be signed in to change notification settings - Fork 34
ST6RI-830 Global scope notation (KERML_-101) #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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::FunctionalRequirementCheck
resolves to the appropriate element of the library packageRequirements
, which would otherwise be hidden by the containingRequirements
package.Changes
org.omg.kerml.expressions.xtext
QualifiedName
production inKerMLExpressions.xtext
to optionally allow a global scope qualification$::
.org.omg.kerml.xtext.naming
KerMLQualifiedNameConverter
to handle globally-scoped qualified names.org.omg.kerml.xtext.scoping
KerMLScope
andKerMLGlobalScope
to resolve globally-scoped qualified names.org.omg.sysml.util
ElementUtil.parseQualifiedName
to handle global scope notation.