Linking of duplicate objects in Xtext [message #1721555] |
Thu, 28 January 2016 09:55 |
|
Hi All,
I have 2 sample languages . This example uses 4 different files.
Kindly have a look below.
DSL1.dmodel
entity e1 {
...
}
imports[..]
exports[e1]
DSL2.dmodel
entity e1 {
...
}
imports[..]
exports[e1]
DSL3.dmodel
entity e2 {
...
}
imports[e1]
exports[..]
DSL4.mymodel
You can observe DSL3.dmodel imports e1. It could be linked to any object from DSL1.dmodel and DSL2.dmodel randomly.
I have one more main language i.e DSL4.mymodel which has access to all the entity objects ( I do it by importing the namespace.).
I have one specific requirement. DUPLICATE ENTITY OBJECTS ARE NOT ALLOWED in DSL4.mymodel so I exclude them using exclude block.
In the above snippet I have excluded DSL2.e1.
Now, what I want to achieve is : when I exclude one instance then remaining instance should be linked in all other places.
i.e. I have excluded DSL2.e1 in DSL4.mymodel, so DSL1.e1 should be linked everywhere E.g. imports[e1] in DSL3.dmodel.
Can we achieve this ? If yes, any hints ?
Thanks for any help!
Regards,
Arshad
Arshad
|
|
|
Re: Linking of duplicate objects in Xtext [message #1721669 is a reply to message #1721555] |
Fri, 29 January 2016 05:15 |
|
Basically you have to reduce the scope for the imports reference based on the exclude elements. Thus, when computing the import scope, query the (global) export scope and filter all qualified names from there. I'm not sure if this would work, but at least I would start investigatin g in this direction.
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
Powered by
FUDForum. Page generated in 0.01872 seconds