Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Bug (?) in Inheritance-hierarchy of matched rules
Bug (?) in Inheritance-hierarchy of matched rules [message #1690215] Wed, 25 March 2015 17:27 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I just found a strange behaviour while creating an inheritance hierarchy of matched rules.

Here some code:

abstract rule SuperProp2Field {
	from
		prop : IN!Prop
	to 
		field : OUT!Field (	)
}

rule SuperRuleMiddle extends SuperProp2Field  {
	from
		prop : IN!Prop (prop.upper > 0)
	--to //BUG will appears here, if the"to" keyword is missing
		 
}

rule Prop2SpecialSetterForUpperBigger1 extends SuperRuleMiddle {
	from
		prop : IN!Prop (prop.getOwnerClass.allOperations->select(op| op.name = 'getter' + prop.name)->isEmpty())
	to 
		target : OUT!Method (
			name<-'getter' + prop.name //NOT POSSIBLE TO SET, if the 'to' keyword in SuperRuleMiddle is not set
		)
}


The bug appears only if the to-keyword is missing in one of the super-rules in the hierarchy.
Normaly the output-pattern of sub and super-rules are joined (see here: https://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Rule_inheritance), but if the super-rule doesn't have an output patter, it is not possible to
set the bindings in the sub-rule.

Is this a normal behavior?
~Alex
Re: Bug (?) in Inheritance-hierarchy of matched rules [message #1690289 is a reply to message #1690215] Thu, 26 March 2015 11:14 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Seems to be a bug in the regular ATL VMs indeed. Note that you generally don't want to change the default output element in sub-rules, as this changes the implicit source-to-target element tracing. Therefore, you would normally repeat the "field" output element in each sub-rule as the first element (without any bindings).

Also note this bug does not occur in ATL/EMFTVM.


Cheers,
Dennis
Previous Topic:simple rules transformation problem
Next Topic:Generation of elements and refereces between them
Goto Forum:
  


Current Time: Thu Mar 28 18:17:41 GMT 2024

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

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

Back to the top