3 DSLs, references inbetween and eProxies [message #1402774] |
Thu, 17 July 2014 13:28 |
Florian Dunz Messages: 20 Registered: March 2014 |
Junior Member |
|
|
Hi,
I've got two problems which i just can't solve by myself. I'd gladly appreciate some help.
Here's what i got so far:
3 Xtext dsls. Mabl, Mosa, Mobe.
Mabl references a class from Mosa, while Mosa references Mobe.
Here are my Xtext files
Mabl.xtext:
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://.../xtext/mosa/Mosa" as mosa
import "http://.../xtext/mobe/Mobe" as mobe
Mabl:
head=STRING
mosas+=MosaReference*
;
MosaReference:
mosaReference=[mosa::Mosa] (COLON mobeReference=[mobe::Mobe])? range=STRING?
;
Mosa.xtext:
import "http://.../xtext/mobe/Mobe" as mobe
Mosa:
name=STRING
mobeReferences+=[mobe::Mobe]*
;
Mobe.xtext:
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Mobe:
'name' name=STRING
images+=Images*
'text1' text1=STRING?
'text2' text2=STRING?
metainfos=Metainfos?
;
Images:
'img' path=STRING
;
Metainfos:
'author' author=STRING
'date' date=STRING
'version' version=STRING
;
Now to the main problems:
1. As you can see in the "MosaReference" in the Mabl.xtext I first load the mosaReference with a reference of [mosa::Mosa] and then I'm allowed to load mobeReference with [mobe::Mobe]. Currently all references for [mobe::Mobe] are accepted. Though now I only want to allow references from [mobe::Mobe] which are references inside the previously set [mosa::Mosa]. Basically I only want to display the entires of the list "mobeReferences" from Mosa.xtext corresponding to the [mosa::Mosa] in front.
How do i achive this?
EDIT: I just found the solution for question 1 here: https://www.eclipse.org/forums/index.php/t/794151/
After searching for so long i just find it by randomly scrolling the frontpage...
2. When I'm parsing those files with the standalone parser I got problems with eProxies. I then searched and found a half working solution. I had to add all resources prior to resolving. Unfortunately as I'm parsing the .mabl file, this only works for the references from Mabl to Mosa, not however for the references from Mosa to Mobe. Any ideas on this one?
Thanks for your help,
Florian
[Updated on: Fri, 18 July 2014 06:10] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: 3 DSLs, references inbetween and eProxies [message #1403070 is a reply to message #1403068] |
Mon, 21 July 2014 08:07 |
Florian Dunz Messages: 20 Registered: March 2014 |
Junior Member |
|
|
If I change the code from:
injector = new MablStandaloneSetup().createInjectorAndDoEMFRegistration();
new MobeStandaloneSetup().createInjectorAndDoEMFRegistration();
new MosaStandaloneSetup().createInjectorAndDoEMFRegistration();
injector.injectMembers(this);
to:
injector = new MablStandaloneSetup().createInjectorAndDoEMFRegistration();
injector.injectMembers(this);
the referencing works, however then I get eProxies again.
[Updated on: Mon, 21 July 2014 08:43] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03518 seconds