Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » Sequence of Transformation
Sequence of Transformation [message #469382] Wed, 11 March 2009 13:41 Go to next message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi,
I want to know if I can call two or more *.m2t files in the transformation
process, because in the most of time I need it and do one by one isn't
very practical.

Thanks for the attention.
Re: Sequence of Transformation [message #469389 is a reply to message #469382] Sun, 15 March 2009 09:34 Go to previous messageGo to next message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Fabricio,

If I understrand you correctly, you will like to call differernt
transformations with different source models.

To accomplish this you will have to write a small Jave program, in the help
section, you will find a simple example for calling one transformation.
If it is the same source, you can just use the import mechanism.

/G
Re: Sequence of Transformation [message #469395 is a reply to message #469389] Wed, 18 March 2009 13:11 Go to previous messageGo to next message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi,

It was the second case, now I have one transformation which import all
other rules, but I have a problem in same cases when I tried to do a
import in one file which already had being imported, for exemple:

File A import B and C.
File B import D.

When I compile B, no error appear, but when I compile A it says that can't
find D.

other thing that I want know is "When I need to extend one transformation
to other?"
I tried to do a exemple with extend, but I needed to import the other file
which have the transformation. So with the import I already have the acess
to the rules of the other transformation.
Can you show me a exemple when extend can be used?


Thanks
Re: Sequence of Transformation [message #469399 is a reply to message #469395] Sun, 22 March 2009 02:41 Go to previous messageGo to next message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Fabrico,

Have to look into this in detail, it might be a bug.

When it comes to transformation inheritance it is works quite as usual.
A transformation may extends another transformation using the extends
keyword. Only single inheritance is allowed.
The sub transformation inherits all rules of the super transformation, may
override these and call the rules of the super using the 'super' keyword.
The example copied from "help->mofcsript" in eclipse, and also described in
User Manual section 5.15 Transformation inheritance.

import "TestInheritanceSuper.m2t"
texttransformation TestInheritanceSub (in ecmodel:ecore) extends
TestInheritanceSuper {
ecmodel.EPackage::main() {
self.printMe()
}
ecmodel.EPackage::printMe() {
stdout.println ("TestIneritanceSub::printMe<")
super.printMe();
stdout.println ("TestIneritanceSub::printMe>")
}
}

Cheers,
G
Re: Sequence of Transformation [message #469405 is a reply to message #469399] Mon, 23 March 2009 18:24 Go to previous message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi again,

I had seen the samples of inheritance and I understood, but I didn't see
much diference between import a transformation file and extends to other
transformation. Because if I do a import, I have all the acess to the
imported transformation, so why extends? the only diference wich I could
see was the override.
Am I wrong?

Thanks

Gøran K. Olsen wrote:

> Hello Fabrico,

> Have to look into this in detail, it might be a bug.

> When it comes to transformation inheritance it is works quite as usual.
> A transformation may extends another transformation using the extends
> keyword. Only single inheritance is allowed.
> The sub transformation inherits all rules of the super transformation, may
> override these and call the rules of the super using the 'super' keyword.
> The example copied from "help->mofcsript" in eclipse, and also described in
> User Manual section 5.15 Transformation inheritance.

> import "TestInheritanceSuper.m2t"
> texttransformation TestInheritanceSub (in ecmodel:ecore) extends
> TestInheritanceSuper {
> ecmodel.EPackage::main() {
> self.printMe()
> }
> ecmodel.EPackage::printMe() {
> stdout.println ("TestIneritanceSub::printMe<")
> super.printMe();
> stdout.println ("TestIneritanceSub::printMe>")
> }
> }

> Cheers,
> Gøran


> "Fabricio Pellegrini" <fabricio.pellegrini@gmail.com> wrote in message
> news:8d0eb19d47e5856929d87e5f737ed140$1@www.eclipse.org...
>> Hi,
>>
>> It was the second case, now I have one transformation which import all
>> other rules, but I have a problem in same cases when I tried to do a
>> import in one file which already had being imported, for exemple:
>>
>> File A import B and C.
>> File B import D.
>> When I compile B, no error appear, but when I compile A it says that can't
>> find D.
>>
>> other thing that I want know is "When I need to extend one transformation
>> to other?" I tried to do a exemple with extend, but I needed to import the
>> other file which have the transformation. So with the import I already
>> have the acess to the rules of the other transformation. Can you show me a
>> exemple when extend can be used?
>>
>>
>> Thanks
>>
Re: Sequence of Transformation [message #567977 is a reply to message #469382] Sun, 15 March 2009 09:34 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Fabricio,

If I understrand you correctly, you will like to call differernt
transformations with different source models.

To accomplish this you will have to write a small Jave program, in the help
section, you will find a simple example for calling one transformation.
If it is the same source, you can just use the import mechanism.

/G
Re: Sequence of Transformation [message #568009 is a reply to message #469389] Wed, 18 March 2009 13:11 Go to previous message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi,

It was the second case, now I have one transformation which import all
other rules, but I have a problem in same cases when I tried to do a
import in one file which already had being imported, for exemple:

File A import B and C.
File B import D.

When I compile B, no error appear, but when I compile A it says that can't
find D.

other thing that I want know is "When I need to extend one transformation
to other?"
I tried to do a exemple with extend, but I needed to import the other file
which have the transformation. So with the import I already have the acess
to the rules of the other transformation.
Can you show me a exemple when extend can be used?


Thanks
Re: Sequence of Transformation [message #568041 is a reply to message #469395] Sun, 22 March 2009 02:41 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Fabrico,

Have to look into this in detail, it might be a bug.

When it comes to transformation inheritance it is works quite as usual.
A transformation may extends another transformation using the extends
keyword. Only single inheritance is allowed.
The sub transformation inherits all rules of the super transformation, may
override these and call the rules of the super using the 'super' keyword.
The example copied from "help->mofcsript" in eclipse, and also described in
User Manual section 5.15 Transformation inheritance.

import "TestInheritanceSuper.m2t"
texttransformation TestInheritanceSub (in ecmodel:ecore) extends
TestInheritanceSuper {
ecmodel.EPackage::main() {
self.printMe()
}
ecmodel.EPackage::printMe() {
stdout.println ("TestIneritanceSub::printMe<")
super.printMe();
stdout.println ("TestIneritanceSub::printMe>")
}
}

Cheers,
G
Re: Sequence of Transformation [message #568066 is a reply to message #469399] Mon, 23 March 2009 18:24 Go to previous message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi again,

I had seen the samples of inheritance and I understood, but I didn't see
much diference between import a transformation file and extends to other
transformation. Because if I do a import, I have all the acess to the
imported transformation, so why extends? the only diference wich I could
see was the override.
Am I wrong?

Thanks

Gøran K. Olsen wrote:

> Hello Fabrico,

> Have to look into this in detail, it might be a bug.

> When it comes to transformation inheritance it is works quite as usual.
> A transformation may extends another transformation using the extends
> keyword. Only single inheritance is allowed.
> The sub transformation inherits all rules of the super transformation, may
> override these and call the rules of the super using the 'super' keyword.
> The example copied from "help->mofcsript" in eclipse, and also described in
> User Manual section 5.15 Transformation inheritance.

> import "TestInheritanceSuper.m2t"
> texttransformation TestInheritanceSub (in ecmodel:ecore) extends
> TestInheritanceSuper {
> ecmodel.EPackage::main() {
> self.printMe()
> }
> ecmodel.EPackage::printMe() {
> stdout.println ("TestIneritanceSub::printMe<")
> super.printMe();
> stdout.println ("TestIneritanceSub::printMe>")
> }
> }

> Cheers,
> Gøran


> "Fabricio Pellegrini" <fabricio.pellegrini@gmail.com> wrote in message
> news:8d0eb19d47e5856929d87e5f737ed140$1@www.eclipse.org...
>> Hi,
>>
>> It was the second case, now I have one transformation which import all
>> other rules, but I have a problem in same cases when I tried to do a
>> import in one file which already had being imported, for exemple:
>>
>> File A import B and C.
>> File B import D.
>> When I compile B, no error appear, but when I compile A it says that can't
>> find D.
>>
>> other thing that I want know is "When I need to extend one transformation
>> to other?" I tried to do a exemple with extend, but I needed to import the
>> other file which have the transformation. So with the import I already
>> have the acess to the rules of the other transformation. Can you show me a
>> exemple when extend can be used?
>>
>>
>> Thanks
>>
Previous Topic:Sequence of Transformation
Next Topic:Contribution for MOFScript project
Goto Forum:
  


Current Time: Thu Jul 30 00:09:08 GMT 2015

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

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