Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » How to call a rule from an other rule
How to call a rule from an other rule [message #1033728] Thu, 04 April 2013 15:14 Go to next message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
Hi,
i'm in search on how to put the result of a simple rule in an other rule!!
for exemple

rule a{
from i:qq!t
to
o:ff!h(
name<- i.name
)
}


rule b{
from i:qq!y
to
o:ff!h(

type<- i.type
)

}

So i want that the rule b have also the attribute name inherited from rule a.
help me and thank you very much.
Re: How to call a rule from an other rule [message #1033792 is a reply to message #1033728] Thu, 04 April 2013 16:49 Go to previous messageGo to next message
Mohamed Mussa is currently offline Mohamed MussaFriend
Messages: 43
Registered: August 2010
Location: Canada
Member
Hi,

I think you need to use rule inheritance as described in the user guide

http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Rule_inheritance


Yours,

Mohamed
Re: How to call a rule from an other rule [message #1033801 is a reply to message #1033792] Thu, 04 April 2013 17:00 Go to previous message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
thank you for the response but I do like this but it generate an empty XMI


<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>

and this is my code:

rule G extends g1{
from
i : XML!Element
( i.name='P' and i.getStringAttrValue('type')='aa')
to

om: S!G (

a1 <- i.getStringAttrValue('a1'),
a2<- i.getStringAttrValue('a2')
)
}

abstract rule g1{
from
i:XML!Element
(i.name='AT' and i.getStringAttrValue('name')='F')
to
o:S!G(

f<- i.getStringDataValue()
)
}

[Updated on: Thu, 04 April 2013 17:16]

Report message to a moderator

Previous Topic:how to call a java method in an atl code
Next Topic:Order of Transformation
Goto Forum:
  


Current Time: Fri Apr 19 21:01:57 GMT 2024

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

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

Back to the top