Home » Archived » MOFScript » Sequence of Transformation
| | | |
Re: Sequence of Transformation [message #469405 is a reply to message #469399] |
Mon, 23 March 2009 18:24 |
Fabricio Pellegrini 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 #568066 is a reply to message #469399] |
Mon, 23 March 2009 18:24 |
Fabricio Pellegrini 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
>>
|
|
|
Goto Forum:
Current Time: Thu Sep 19 10:41:38 GMT 2024
Powered by FUDForum. Page generated in 0.04365 seconds
|