How to create a call to a helper in a HOT? [message #1114919] |
Mon, 23 September 2013 12:11 |
EtienneB Mising name Messages: 35 Registered: June 2011 |
Member |
|
|
Dear all,
I am writing a HOT (higher order transformation) that takes as input an ATL model and produces an ATL model.
In the output model, I create a helper and I want to add a call to this helper in one of the rules I produce.
Here is the code I use in the HOT to create the call to a helper:
lazy rule createHelperCall {
from
theOperationName: String
to
call: MM_ATL!OperationCallExp(
operationName <- theOperationName,
source <- thisModule.getOutputModule()
)
do
{
call;
}
}
getOutputModule is a helper that returns the output module created by the HOT.
Unfortunaltely, this does not work and I have no idea how to fill in the "source" field in order to produce something like this in the output ATL code:
thisModule.<theOperationName>()
Can someone give me a hint about this?
Thanks,
Etienne.
[Updated on: Mon, 23 September 2013 18:03] Report message to a moderator
|
|
|
|
|
Re: How to create a call to a helper in a HOT? [message #1115133 is a reply to message #1115076] |
Mon, 23 September 2013 18:02 |
EtienneB Mising name Messages: 35 Registered: June 2011 |
Member |
|
|
OK, just had to create a VariableDeclaration object and assign its field varName the value 'thisModule'. The created object is then assigned to the referrefVariable field of my VariableExp object.
Here is the code I have now:
lazy rule createHelperCall {
from
theOperationName: String
to
argcall: MM_ATL!OperationCallExp(
operationName <- theOperationName,
source <- currentModuleExp
),
currentModuleExp: MM_ATL!VariableExp
(
referredVariable <- currentModuleDecl
),
currentModuleDecl: MM_ATL!VariableDeclaration
(
varName <- 'thisModule'
)
do
{
argcall;
}
}
[Updated on: Mon, 23 September 2013 18:02] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04061 seconds