Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Lazy Rule Inheritance with multiple Arguments(Using lazy rule inheritance on rules with multiple arguments cause error.)
[ATL] Lazy Rule Inheritance with multiple Arguments [message #515014] Wed, 17 February 2010 13:55
Arjan  van der Meer is currently offline Arjan van der MeerFriend
Messages: 8
Registered: February 2010
Junior Member
Hello,

I am working on a transformation for PicoJava programs. A crucial point in the transformation is that statements can be transformed differently depending on the environment. In order to do this, I wanted to use lazy rules like in the example below (here with only one alternative, but there should be more).

-- @path MM=platform:/plugin/PicoJava/model/PicoJava.ecore

module LazyRuleExample;
create OUT : MM from IN : MM;

rule Package {
	from 
	    s:MM!Package
		
	to
	    t:MM!Package (
	       declarations <- s.declarations,
		   statements <- s.statements
	    )
}

unique lazy abstract rule Example {
	from
	    s:TupleType(stat : MM!Statement, env : Sequence(MM!Declaration))
		
	to
	    t:MM!Statement 
}

unique lazy rule Example2 extends Example {
    from
	    s:TupleType(stat : MM!Statement, env : Sequence(MM!Declaration))(s.stat.oclIsKindOf(MM!AssignStatement))
		
	to
	    t:MM!AssignStatement
}


However, when I try to execute the transformation, the following error occurs:

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: org.eclipse.m2m.atl.engine.asm.ASMEmitter@11d8f11.emit(java.lang.String,org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined)
	at process_checkSubRules(ATLCompiler.atl[1073:5-1073:23])
		local variables: self=IN!Example:ATL!LazyMatchedRule, forEach=Sequence {IN!Example2:ATL!LazyMatchedRule}, subRule=IN!Example2:ATL!LazyMatchedRule, forEach=Sequence {IN!<unnamed>:ATL!SimpleInPatternElement}, ipe=IN!<unnamed>:ATL!SimpleInPatternElement
	at process(ATLCompiler.atl[1063:5-1063:36])
		local variables: self=IN!Example:ATL!LazyMatchedRule
	at process(ATLCompiler.atl[448:3-448:24])
		local variables: self=IN!LazyRuleExample:ATL!Module
	at main(ATLCompiler.atl)
		local variables: self=thisModule, WriteTo='C:/Users/ameer/workspace/PicoJavaType/LazyRuleExample.asm'


I also tried:

unique lazy abstract rule Example3 {
	from
	    stat : MM!BasicReference,
		env : Sequence(MM!Declaration)
	to
	    t:MM!BasicReference
}

unique lazy rule Example4 extends Example3{
	from
	    stat : MM!VariableReference,
		env : Sequence(MM!Declaration)
	to
	    t:MM!VariableReference
}


But that gives the same error.

This happens even though the rules are never actually used. I tried mostly the EMF VM but also the regular one, with similar results. It seems to me that there is a problem with lazy rules with multiple arguments and inheritance, but I could be wrong.

Are there any known limitations on inheritance and/or lazy rules with multiple arguments? The manual is rather brief on those points. Alternatively, is there another way to get multiple implementations of a lazy rule that does work with multiple arguments?

Regards,
Arjan van der Meer
Previous Topic:[ATL] Transformations with ATL 3.0.0 and 3.0.1
Next Topic:CFP: 2nd International Workshop on Model Transformation with ATL (MtATL 2010)
Goto Forum:
  


Current Time: Wed Apr 24 21:02:27 GMT 2024

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

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

Back to the top