Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Clean problem for DSLs in Xtext(Clean problem for DSLs in Xtext)
icon5.gif  Clean problem for DSLs in Xtext [message #1386368] Tue, 17 June 2014 07:32 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
HI,
I have three dsl files .model1, .model2 and .model3.
So I will be having 3 generators here, one for each dsl.

But .model3 file refers data from .model1 and .model2.
Work flow of .model3 generator is, first .model1 data will be modified and then .model2 data will be modified and this data will be used to generate output in .model3 generator.


But when I clean my complete project, .model1 generator will be called and .model2 and then .model3.
But data is already modified in first 2 generators and it tells me that referred object in .model3 is not there (null) as its already modified.

Is there a way that before calling the .model3 generator I load the raw file data of .model1 and .model2 ?
This problems only occurs during clean ...


Regards,
Arshad


Arshad
Re: Clean problem for DSLs in Xtext [message #1386384 is a reply to message #1386368] Tue, 17 June 2014 09:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13530
Registered: July 2009
Senior Member
There should no data be modified

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
icon5.gif  Re: Clean problem for DSLs in Xtext [message #1386387 is a reply to message #1386384] Tue, 17 June 2014 09:51 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,
Thanks for your reply. I exactly don't know what's going wrong.

More detailed example:
1. When .model1 generator is called say object "M1obj_x[2]" is coverted to M1obj_1 and M1obj_2.

2. When .model2 generator is called say object "M2obj_x[2]" is coverted to M2obj_1 and M2obj_2.

3. When .model3 generator is called, Step 1. and 2. mentioned above are called and some specific modification related to .model3 generator is done.

It works perfectly independently.

But when I clean the complete project, I observed that objects are already modified to M1obj_1 and M1obj_2 and M2obj_1 and M2obj_2 and the referred object in .model3
i.e. M1obj_x[2] and M2obj_x[2] fails to expand as original object is not there.

There is no any other configuration is done before generator is called.

Any suggestions you could give me?
Or is it possible to reload the raw data exisitng in the file again to a resource ?


Regards,
Arshad


Arshad
Re: Clean problem for DSLs in Xtext [message #1386408 is a reply to message #1386387] Tue, 17 June 2014 11:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13530
Registered: July 2009
Senior Member
Hi i habe no idea what you actially doing in your generator but it
seems the wrong place to do that. Can you give more Details (example)
Of what you do and why


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
icon5.gif  Re: Clean problem for DSLs in Xtext [message #1386528 is a reply to message #1386408] Wed, 18 June 2014 06:41 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,
Thanks for your reply. As I said, I am expanding objects in all the three models.
A simple example would be :
array{placeholder=x name=arr max=2}
M1obj_x[arr]

So in in generator 1 and generator 2 these objects would become M1obj_1 and M1obj_2.
If max=3 then it would become M1obj_1, M1obj_2 and M1obj_3. (Obviously objects are different in all the models, its the generic explanation of what I do).
This is for generator 1 and generator 2. Some outputs are generated out of generaor1 and generator 2.

But in the third resource i.e. .model3 I refer objects from .model1 and .model2 in the raw form
i.e.

....
refers M1obj_x[arr1] (from .model1)
refers M2obj_x[arr2] (from .model2)
....


So in generator 3, first I call generator 1 and generator 2 functionality to expand objects and use combination of these objects to produce some output.

When I edit and save the file, everything works fine.
BUT WHEN I CLEAN THE WHOLE PROJECT, THE REFERRED OBJECTS ARE ALREADY EXPANDED (BEFORE I CALL GENERATOR 1 AND GENERATOR 2 FUNCTIONALITY). HENCE I AM NOT GETTING THE DESIRED RESULT OUT OF GENERATOR 3.



Regards,
Arshad


Arshad

[Updated on: Wed, 18 June 2014 06:42]

Report message to a moderator

Re: Clean problem for DSLs in Xtext [message #1386535 is a reply to message #1386528] Wed, 18 June 2014 07:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13530
Registered: July 2009
Senior Member
Hi,

i still do no understand what "expanding objects" means.
manipulating the ast should imho done be in the IDerivedStateComputer and not in the IGenerator


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Clean problem for DSLs in Xtext [message #1386558 is a reply to message #1386535] Wed, 18 June 2014 09:19 Go to previous message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 128
Registered: June 2014
Senior Member
Hi Arshad,

One solution for the problem is, to store the unexpanded values to a map before generator 1 gets called, and restore it again for generator 2 to expand it.

But there can be better solution for the problem.

Best regards,
Virag Purnam
Previous Topic:[SOLVED] Generate xtend-gen classes from headless build
Next Topic:Integrate and validate OCL grammer in XText
Goto Forum:
  


Current Time: Sat Aug 15 01:50:49 GMT 2020

Powered by FUDForum. Page generated in 0.02628 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top