Skip to main content



      Home
Home » Modeling » ATL » [ATL] Rule inheritance with several 'from' elements
[ATL] Rule inheritance with several 'from' elements [message #1063095] Wed, 12 June 2013 05:35 Go to next message
Eclipse UserFriend
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 09:01 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: [ATL] Rule inheritance with several 'from' elements [message #1063414 is a reply to message #1063139] Thu, 13 June 2013 02:37 Go to previous message
Eclipse UserFriend
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
Previous Topic:helper attribute
Next Topic:Simple Containment issue
Goto Forum:
  


Current Time: Wed Jul 23 09:32:45 EDT 2025

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

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

Back to the top