[QVTO] access to transformation properties [message #512635] |
Fri, 05 February 2010 12:32  |
Eclipse User |
|
|
|
Hi,
I'm writing a qvto script that exploits the import capability by access semantic.
I need to access to the non-intermediate contextual properties of the imported qvto scripts.
An imported script property is accessible from the instantiator except when it is inherited.
For example, let's define an imported script A.qvto and a script Main.qvto
-- A.qvto file
transformation A();
property info : String = '';
main() {
info := 'A';
}
-- Main.qvto file
import A;
transformation Main() access A;
main() {
var a := new A();
assert fatal(a.info='');
a.transform();
assert fatal(a.info='A');
}
It works fine in this case. Instead, it's not working in the following case.
Let's define a B.qvto as extension of A.qvto and modify Main.qvto.
-- B.qvto file
import A;
transformation B() extends A;
main() {
info := 'B';
}
-- Main.qvto file
import B;
transformation Main() access B;
main() {
var b := new B();
b.transform();
assert fatal(b.info='B');
}
Inherited property 'info' is accessible from B.qvto, but it is not accessible from Main.qvto.
Indeed, line "info := 'B'" works correctly and it is raised "Unrecognizable variable (info)" exception in line "assert fatal(b.info='B')".
Could the qvto engine be modified in order to access to inherited properties from the instantiator?
Thanks a lot!
Cheers,
Andrea
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.42303 seconds