Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [ATL] Rule inheritance with several 'from' elements
[ATL] Rule inheritance with several 'from' elements [message #1063095] Wed, 12 June 2013 09:35 Go to next message
Gunnar Arndt is currently offline Gunnar ArndtFriend
Messages: 82
Registered: June 2012
Member
Hi members,

I have a problem with the following set of rules:

-- @atlcompiler atl2006
module transformate2startek;
create OUT: startek from IN: transformate;

lazy abstract rule AbstractAbstractTreeNode {
    from
		source: transformate!AbstractTreeNodeTransformer,
		predecessors: Map(transformate!Transformer, startek!Document),
		successors: Map(String, startek!Document)
    to
		target: startek!Document ( -- Document is an abstract class (this does not run with atl2004, but compiles no problem with atl2004).
			id <- thisModule -> getId(),
			source <- source.sourceUrl
		)
}

-- ExceptionHandlerNodeTransformer extends AbstractTreeNodeTransformer
-- Cause extends Document
lazy rule ExceptionHandlerNode extends AbstractAbstractTreeNode {
    from
		source: transformate!ExceptionHandlerNodeTransformer,
		predecessors: Map(transformate!Transformer, startek!Document),
		successors: Map(String, startek!Document)
    to
		target: startek!Cause (
			text <- source.exceptionClass
		)
}

-- ReturnNodeTransformer extends AbstractTreeNodeTransformer
-- Result extends Document
lazy rule ReturnNode extends AbstractAbstractTreeNode {
    from
		source: transformate!ReturnNodeTransformer,
		predecessors: Map(transformate!Transformer, startek!Document),
		successors: Map(String, startek!Document)
    to
		target: startek!Result (
			text <- source.result
		)
}


The compiler gives me the following message:

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: org.eclipse.m2m.atl.engine.asm.ASMEmitter@4907d90c.emit(java.lang.String,org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined)
	at process_checkSubRules#39(ATLCompiler.atl[1098:5-1098:23])
		local variables: self=IN!AbstractAbstractTreeNode, forEach=Sequence {IN!ExceptionHandlerNode, IN!ReturnNode}, subRule=IN!ExceptionHandlerNode, forEach=Sequence {IN!<unnamed>, IN!<unnamed>, IN!<unnamed>}, ipe=IN!<unnamed>
	at process#236(ATLCompiler.atl[1088:5-1088:36])
		local variables: self=IN!AbstractAbstractTreeNode
	at process#2066(ATLCompiler.atl[463:3-463:24])
		local variables: self=IN!transformate2startek
	at main#37(ATLCompiler.atl)
		local variables: self=ATLCompiler : ASMModule, WriteTo='transformate2startek.asm'


Is it illegal to have rule inheritance with multiple source elements? I don't think so, as atl2004 compiles the program, but it cannot be run then, as the abstract rule has an abstract output element.

Thanks for your help.
Re: [ATL] Rule inheritance with several 'from' elements [message #1063139 is a reply to message #1063095] Wed, 12 June 2013 13:01 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
First I advice you to always use the latest version of the compiler, especially when using advanced features such as rule inheritance.
You should ensure that your inheritance hierarchy is correct (cf. the corresponding section in the documentation).

Also, in the "from" part of a rule, ATL is normally expecting one or several input model elements and not Maps.
Are you sure you need them? They don't seem to be used in the provided excerpt.
If you really need such maps, they have to be declared and initialized as helper attributes.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: [ATL] Rule inheritance with several 'from' elements [message #1063414 is a reply to message #1063139] Thu, 13 June 2013 06:37 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Op 12-06-13 15:01, Hugo Bruneliere schreef:
> First I advice you to always use the latest version of the compiler,
> especially when using advanced features such as rule inheritance.
> You should ensure that your inheritance hierarchy is correct (cf. the
> http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Rule_inheritance).
>
> Also, in the "from" part of a rule, ATL is normally expecting one or several
> input model elements and not Maps.
> Are you sure you need them? They don't seem to be used in the provided excerpt.
> If you really need such maps, they have to be declared and initialized as
> http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Attributes.

EMFTVM focuses on improving rule inheritance. Can you try with:

-- @atlcompiler emftvm

Thanks,
Dennis


Cheers,
Dennis
Previous Topic:helper attribute
Next Topic:Simple Containment issue
Goto Forum:
  


Current Time: Fri Apr 26 18:45:43 GMT 2024

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

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

Back to the top