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