Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Matched rule without a "to" section
Matched rule without a "to" section [message #91251] Fri, 03 October 2008 16:47 Go to next message
Eclipse UserFriend
Originally posted by: matteo.risoldi.unige.ch

Hello,

I noticed in my transformations that, at least using the atl2006
compiler, it seems acceptable to have a matched rule (not called)
without a "to" section, but only with "from" and "do", like the
following:

rule initCFC {
from
cfc : COOPNModel!COOPNPackage,
spec : cospel!Specification
do{
thisModule.CFCMODEL <-cfc;
thisModule.ruleSpecification(spec);
}
}

This works perfectly in my project. Is this foreseen behaviour? I ask
because it doesn't match the grammar shown in the ATL manual, where the
"to" section is not marked as optional.
I would like to know if I should use this pattern, or if I should
expect a bug fix in subsequent atl versions which would kill my
transformations written this way...

Thanks for the information.
Best regards
Matteo
Re: Matched rule without a "to" section [message #91513 is a reply to message #91251] Tue, 07 October 2008 08:50 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Matteo,

I think you can do that without problems; I used it for the past
but ATL doesn't recommend the usage of "to" sections so be careful when
you do this.

For example you never know when the rules are matched and when the to
section is performed (generally at the end) so at a specific moment you
will want to use your var CFCModel but the var will be set once and the
second time won't be

Matteo Risoldi a écrit :
> Hello,
>
> I noticed in my transformations that, at least using the atl2006
> compiler, it seems acceptable to have a matched rule (not called)
> without a "to" section, but only with "from" and "do", like the following:
>
> rule initCFC {
> from
> cfc : COOPNModel!COOPNPackage,
> spec : cospel!Specification
> do{
> thisModule.CFCMODEL <-cfc;
> thisModule.ruleSpecification(spec);
> }
> }
>
> This works perfectly in my project. Is this foreseen behaviour? I ask
> because it doesn't match the grammar shown in the ATL manual, where the
> "to" section is not marked as optional.
> I would like to know if I should use this pattern, or if I should expect
> a bug fix in subsequent atl versions which would kill my transformations
> written this way...
>
> Thanks for the information.
> Best regards
> Matteo
>




Previous Topic:[ATL] running transformations programatically under xmi
Next Topic:[QVTO] Model migration / evolution
Goto Forum:
  


Current Time: Wed Apr 24 18:49:34 GMT 2024

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

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

Back to the top