|
|
Re: Transform multiple elements in one [message #1844404 is a reply to message #1844100] |
Mon, 13 September 2021 09:04 |
Tomas Wall Messages: 53 Registered: April 2021 |
Member |
|
|
Hi Dimitris,
Sorry for that. Here goes the right link: https://www.eclipse.org/epsilon/live/?8fe19286
The source metamodel is actually generated from Xtext, while the target metamodel is create in EMF.
Now in Xtext, the grammar is as follows:
________________________________________
Forest:
name=ID "{"
areas += Area;
"}"
Area:
name=ID "." trees+=Tree;
Tree:
name=ID;
________________________________________
And an instance model of this grammar is this:
Forest F1 {
area1.tree1;
}
_________________________________________
Now when I write the transformation I want area1.tree1 to be transformed into one single location, so the target model should be something like this:
ForestF1
---> Location area1.tree1
_______________________________________
However, I also want to be able to write the reverse transformation so that:
Location area1.tree1
can be transformed into
Area area1
---> Tree tree1
So a rule that would somehow check where the period is and would transform the element before the period in an area and the element after the period in a tree
Thank you in advance,
Tomas
[Updated on: Mon, 13 September 2021 11:08] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03179 seconds