Skip to main content



      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 03:32 Go to next message
Eclipse UserFriend
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
Re: Clean problem for DSLs in Xtext [message #1386384 is a reply to message #1386368] Tue, 17 June 2014 05:18 Go to previous messageGo to next message
Eclipse UserFriend
There should no data be modified
icon5.gif  Re: Clean problem for DSLs in Xtext [message #1386387 is a reply to message #1386384] Tue, 17 June 2014 05:51 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Clean problem for DSLs in Xtext [message #1386408 is a reply to message #1386387] Tue, 17 June 2014 07:12 Go to previous messageGo to next message
Eclipse UserFriend
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
icon5.gif  Re: Clean problem for DSLs in Xtext [message #1386528 is a reply to message #1386408] Wed, 18 June 2014 02:41 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Wed, 18 June 2014 02:42] by Moderator

Re: Clean problem for DSLs in Xtext [message #1386535 is a reply to message #1386528] Wed, 18 June 2014 03:35 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Clean problem for DSLs in Xtext [message #1386558 is a reply to message #1386535] Wed, 18 June 2014 05:19 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 16:49:54 EDT 2025

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

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

Back to the top