|
|
Re: [ATL] MoDisco .javaxmi files [message #662022 is a reply to message #660944] |
Mon, 28 March 2011 22:34 |
Rob Messages: 17 Registered: February 2011 |
Junior Member |
|
|
Thx 4 your answer, Thanasis.
I was able to solve this problem. It was just a mistake with from/refine keyword in atl module.
But anyway I am running into some strange problems.
Still on javaxmi model based on java.ecore doing transformation from java to java - same metamodel.
I tried to create lazy rules to transfer type information from FieldDeclarations and Parameters, which works so far.
lazy rule F2F {
from
s: Java!FieldDeclaration
to
t : Java!FieldDeclaration (
type <- thisModule.TA2TA(f),
)
}
lazy rule TA2TA {
from
f: Java!TypeAccess
to
t : Java!TypeAccess (
type <- if (f.type.type.oclIsKindOf(Java!PrimitiveTypeVoid))
.....
I am not quite sure, why I have to access type twice here - but this way the checks work - although I can not figure it out from the metamodel. From my understanding it should work with f.type.olcIsKindOf ...
the same code works for Parameters (i.e. SingleVariableDeclarations)
but when I try to transfer returnType in MethodDeclaration I get an error, that type is not valid for MethodDeclaration.
Maybe I am missunderstanding some concepts of ATL. But I dig through the Metamodel and from my point of view it should not matter whether it is type in SingleVariableDeclaration/AbstractVariablesContainer or returnType in MethodDeclaration.
Any hints would be appreciated.
Thx
Rob
[Updated on: Thu, 31 March 2011 09:14] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02207 seconds