Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EReference
EReference [message #874821] Mon, 21 May 2012 15:48 Go to next message
Kosala Yapa is currently offline Kosala YapaFriend
Messages: 159
Registered: September 2010
Senior Member
Hi there,

class Module{ name, address}
class ModuleList{EReference moduleItem of the type Module}

class Model{name, address}
class ModelList{EReference modelItem of the type Model}

problem:

-- @path source=file:/C:/.../Module.ecore
-- @path target=file:/C:/.../Model.ecore

create OUT : target from IN : source;


rule Rule_1{
from
a:source!ModuleList
to
d:target!ModelList(
modelItem.name <- a.moduleItem.name
)

}

Error: no viable alternative at input '.'

Can someone tell me how to resolve this issue? In some other terms, how to use EReferences in ATL programming? Could someone show me a simple example?

Thanks in advance
K

Re: EReference [message #955202 is a reply to message #874821] Tue, 23 October 2012 15:54 Go to previous message
Cesar Caves is currently offline Cesar CavesFriend
Messages: 29
Registered: July 2009
Junior Member
Hi

I think you need a matched rule like the following

rule Module_2_Model {
  from 
    input : source!Module
  to
    output : target!Model (
      name <- input.name,
      address <- input.address
    )
}



So in the bindings of your rule you could write: modelItem <- a.moduleItem

[Updated on: Tue, 23 October 2012 16:02]

Report message to a moderator

Previous Topic:write sequence
Next Topic:How to inject code into java model MethodDeclaration
Goto Forum:
  


Current Time: Tue May 14 22:38:08 GMT 2024

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

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

Back to the top