Skip to main content



      Home
Home » Modeling » ATL » [EMFTVM] How do I call lazy rules?
[EMFTVM] How do I call lazy rules? [message #1386234] Sun, 15 June 2014 12:36 Go to next message
Eclipse UserFriend
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 405 times)
Re: [EMFTVM] How do I call lazy rules? [message #1386299 is a reply to message #1386234] Mon, 16 June 2014 08:14 Go to previous messageGo to next message
Eclipse UserFriend
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;
        }
}


[Updated on: Mon, 16 June 2014 08:14] by Moderator

Re: [EMFTVM] How do I call lazy rules? [message #1386514 is a reply to message #1386299] Wed, 18 June 2014 00:43 Go to previous message
Eclipse UserFriend
I see! Thank you!
Previous Topic:Fwd: XText in combination wit ATL
Next Topic:Execution time & Memory usage
Goto Forum:
  


Current Time: Thu Jul 17 10:25:48 EDT 2025

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

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

Back to the top