How to develop a generator to complete your input model (weaving or not weaving)
Hi,
I have a DSL1 with concepts and generator from concepts to xml.
In which the State concept exists (from statemachine), State has children states for compound states.
I have a DSL2 with generator, I want to add new substates to the input model.
I have no root mapping rules, since I want the statemachine in input copied as it is in the output model.
I am trying weaving rule :
in weave_State I have template fragments for substates.
When I launch generation I have the following error :
failed to generate output after 10 repeated mappings
No transient models are generated (with option ON)
I can make a testcase languages zip for anyone.
I have a DSL1 with concepts and generator from concepts to xml.
In which the State concept exists (from statemachine), State has children states for compound states.
I have a DSL2 with generator, I want to add new substates to the input model.
I have no root mapping rules, since I want the statemachine in input copied as it is in the output model.
I am trying weaving rule :
concept State --> weave_State condition node.needsProcess context : genContext.get copied output for (node);
in weave_State I have template fragments for substates.
When I launch generation I have the following error :
failed to generate output after 10 repeated mappings
No transient models are generated (with option ON)
I can make a testcase languages zip for anyone.
Please sign in to leave a comment.
https://code.google.com/p/mps-lwc11/wiki/lwc11step1At01
https://code.google.com/p/mps-lwc11/wiki/lwc11step2At02
My model looks like:
module Company {
entity Employee {
firstName : string
lastName : string
}
entity Department {
name : string
manager : Employee
}
}
I am making my root mapping concept to be of type, Entity here. As you can see, I can have an attribute of Entity type inside of an another Entity as a reference.
When I run the generator, I get the following error:
"failed to generate output after 10 repeated mappings".
When I see the transient models, this is what I see:
Clearly, something is recursive infinitely.
Were you able to resolve this issue at your end?
Regards
But I will not continue with this because I read a comment saying weaving rules are a hack and should not be used.
Moreover, since 3.0 or 3.1, in place generation is used by default. Using weaving rules break this functionality and since in place generation will maybe the only available mecanism, I dumped using weaving rules and doing all with $IF$ and $MAP_SRC$ macros. Still I believe weaving is an elegant way of implementing generation and I hope they will come with something new.