Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [EMFTVM] How do I call lazy rules?
[EMFTVM] How do I call lazy rules? [message #1386234] Sun, 15 June 2014 16:36 Go to next message
Maxim Gromov is currently offline Maxim GromovFriend
Messages: 7
Registered: May 2014
Junior Member
In Eclipsepedia (http://wiki.eclipse.org/ATL/EMFTVM#Lazy_rules) it is said, that Quote:
lazy rules are not just invoked, but are also matched


What does it mean?

Let say I have simple metamodel like in the picture I've uploaded (index.php/fa/18288/0/).

Then I have ATL file like this:
-- @atlcompiler emftvm
-- @nsURI MM=example/metamodel1
-- @nsURI MM1=example/metamodel1

module One2One;
create OUT : MM1 from IN : MM;

lazy rule SE2SE {
	from
		s : MM!SubElement
	to
		t : MM1!SubElement(
			name <- s.name
			)
}

rule ClassA2ClassA {
	from
		s : MM!ClassA
	to
		t : MM1!ClassA(
			field1 <- s.field1
			)
	do {
		s.array->first()->debug();
		thisModule.SE2SE(s.array->first()).debug();
	}
}


But when I run this transformation I get
One:MM1!SubElement
OclUndefined

as if SE2SE lazy rule does not match (according to Eclipsopedia). What do I do wrong?

Thanks!
  • Attachment: mm.png
    (Size: 4.09KB, Downloaded 74 times)
Re: [EMFTVM] How do I call lazy rules? [message #1386299 is a reply to message #1386234] Mon, 16 June 2014 12:14 Go to previous messageGo to next message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Hello Maxim,

When you use lazy rule with EMFTVM machine, you must return the generated element in the lazy rule. Your rule must look like this:

lazy rule SE2SE {
	from
		s : MM!SubElement
	to
		t : MM1!SubElement(
			name <- s.name
			)
        do {
           t;
        }
}




Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Mon, 16 June 2014 12:14]

Report message to a moderator

Re: [EMFTVM] How do I call lazy rules? [message #1386514 is a reply to message #1386299] Wed, 18 June 2014 04:43 Go to previous message
Maxim Gromov is currently offline Maxim GromovFriend
Messages: 7
Registered: May 2014
Junior Member
I see! Thank you!
Previous Topic:Fwd: XText in combination wit ATL
Next Topic:Execution time & Memory usage
Goto Forum:
  


Current Time: Sun Dec 21 02:45:04 GMT 2014

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

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