Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » How to create a call to a helper in a HOT?
How to create a call to a helper in a HOT? [message #1114919] Mon, 23 September 2013 12:11 Go to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
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 #1114977 is a reply to message #1114919] Mon, 23 September 2013 13:46 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 606
Registered: September 2012
Location: Belgium
Senior Member

The "thisModule" is an ATL!VariableExp, not a Module. Tip: write the ATL code you want to generate by hand, and then use the ATL editor's outline view to see what the abstract syntax tree looks like. It is not always intuitive!

Cheers,
Dennis

[Updated on: Mon, 23 September 2013 13:47]

Report message to a moderator

Re: How to create a call to a helper in a HOT? [message #1115076 is a reply to message #1114977] Mon, 23 September 2013 16:21 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
Hi Dennis,

thanks for your quick answer. Indeed, your hint helps a lot. The problem now is to figure out how to fill the "referrefVariable" field of ATL!VariableExp class. Sorry to ask, but I really don't see what to put there.

Etienne.

[Updated on: Mon, 23 September 2013 17:43]

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 Go to previous message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
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

Previous Topic:Output model tagged values from the stereotype point to the input model
Next Topic:Organizing logical combination of boolean expressions in a HOT
Goto Forum:
  


Current Time: Fri Sep 20 06:39:06 GMT 2024

Powered by FUDForum. Page generated in 0.06918 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top