How to navigate target model [message #102599] |
Fri, 27 March 2009 16:13 |
Eclipse User |
|
|
|
Originally posted by: behnaz.cwi.nl
Hi everyone,
Sorry if I ask this question agaian. I did not get some answer that
solves my problem. It seems that ATL does not allow navigating through
the target model which makes a problem here:
This is a simple reo to reo transformer. But rule
sourceend2sourceend rule where I try to add new Sync (one type of
primitives) and a new node in a rule which is fired on FIFO (another
type of primitives) has a problem.
The problem is also related to connetor2connetor rule, I have: c :
reo!Connector(name<-p.name, nodes<-p.nodes, primitives <- p.primitives).
When new node and sync are generated, they do not place in the module
because of the form of nodes<-p.nodes, primitives <- p.primitives (I think).
William suggested me to set node.connector (set the container info for
elements which should set inside connector). But my model just allows
top-down naavigation.
Thanks in advance,
Behnaz
>> ATL Rules:
>> module reo2reo;
>> create OUT : reo from IN : reo;
>>
>> rule module2module
>> {
>> from
>> s : reo!Module
>> to
>> m : reo!Module(name <- s.name, connectors <- s.connectors)
>> do {s.debug('module2module applied');}
>> }
>>
>> rule connetor2connetor
>> {
>> from
>> p : reo!Connector
>> to
>> c : reo!Connector(name<-p.name, nodes<-p.nodes, primitives
<- p.primitives)
>> do { p.debug('connetor2connetor applied'); }
>> }
>>
>> rule node2node
>> {
>> from
>> p : reo!Node
>> to
>> c : reo!Node(name<-p.name)
>> do { p.debug('node2node applied'); }
>> }
>>
>> rule sourceend2sourceend
>> {
>> from
>> src : reo!SourceEnd
>> to
>> trg : reo!SourceEnd(node <- src.node)
>> do { src.debug('sourceend2sourceend applied');
}
>> }
>>
>> rule sinkend2sinkend
>> {
>> from
>> snk : reo!SinkEnd
>> to
>> trg : reo!SinkEnd(node <- snk.node)
>> do { snk.debug('sinkend2sinkend applied'); }
>> }
>>
>> rule lossysync2sync
>> {
>> from
>> p : reo!LossySync
>> to
>> c : reo!Sync(sourceEnds <- p.sourceEnds, sinkEnds <- p.sinkEnds)
>> do { p.debug('lossysync2sync applied'); }
>> }
>>
>>
>> rule decomposeFIFO
>> {
>> from
>> q : reo!FIFO
>> to
>> sync1 : reo!Sync(sourceEnds <- q.sourceEnds, sinkEnds <- snk1),
>> snk1 : reo!SinkEnd(node <- n1),
>> n1 : reo!Node(name <- 'n1'),
>> sync2 : reo!Sync(sourceEnds <- src2, sinkEnds <- q.sinkEnds),
>> src2 : reo!SourceEnd(node <- n1)
>> do {q.debug('decomposeFIFO applied');}
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03748 seconds