java.ecore Metamodel Type/TypeAccess [message #662590] |
Thu, 31 March 2011 09:01 |
Rob Messages: 17 Registered: February 2011 |
Junior Member |
|
|
Hello again!
I am not quite sure if I should ask the following here or in the M2M ATL Forum, but as I have a problem with ATL Rules on the java.ecore Metamodel which comes with MoDisco I think it should be ok here.
I created a java.ecore based app model with Modisco Reverse Engineering and used ATL to extract some information from this model.
I am running into a problem which maybe one of you guys can clearify.
Let's have some lazy rules say:
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))
.....
The rules work so far for Parameters (SingleVariableDeclaration) and FieldDeclarations.
But 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 or something in the java.ecore Metamodel. 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.
many thx in advance,
Rob
[Updated on: Thu, 31 March 2011 09:13] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02808 seconds