Referencing UML from an Xtext DSL - handling incomplete qualified names [message #1386902] |
Sun, 22 June 2014 21:37 |
Stefan Mijatov Messages: 59 Registered: March 2010 Location: Vienna, Austria |
Member |
|
|
When using import statements for referencing elements from another DSL, such as UML, only references of the top level (those which are at the same level as import statements) have the benefit from those import statements.
It means all the nested elements naturally get the qualified name starting from its parent that was imported. For instance, if I import a package with some class, I can declare the reference to that class with just its simple name, and the resolution will nicely work later. However, to refer to a property of that class, a qualified name of that property is composed of the name of the owner class and the name of the property itself.
This is normal and expected, however, I would like to use the simple name of the property (composed of only the name of the property) and when resolving the reference, use the reference to the class to compile the whole qualified name of the property.
To make my problem more clear, I provide a following example:
import somePackage.*
myDslElement ofType SomeClass { attribute SomeClass.someAttribute = 'aStringValue'}
So in this example I have to use SomeClass.someAttribute, in order for resolving the references to work.. How do I enable nesting the references and then make a qualified name of a reference based on its nesting?
What I want to achieve is this:
import somePackage.*
myDslElement ofType SomeClass { attribute someAttribute = 'aStringValue'}
I thought QualifiedNameProvider can solve this, however, in the QualifiedNameProvider class we only have access to the UML elements, and not the elements of the DSL referencing the UML model..
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24221 seconds