[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: ATL polymorphism

Hi,

Could you please remember to prefix the subject of your ATL-related posts with [ATL]? See: http://wiki.eclipse.org/M2M

It seems that you miss a comma on the line with the syntax error.

Regards,

FrÃdÃric Jouault

marta a Ãcrit :
Hi!
Iïm trying to transform a model with a chain of aggregations to another with an inheritance chain: class a ------- transformation to ------> class A
owns 0..1 instanceOfb owns 0..* instanceOfB
class b class B (abstract)
inherits
owns 0..* instanceOfd class C (abstract)
inherits
class d ------- transformation to ------> class D


For the transformation only the first and last classes of the chain are interesting. Iïd tryed:

rule one {
 from i: model1!a
 to o: model2!A (
   attribute <- i.attribute,

   instanceOfB.D <- i.instanceOfb.instanceOfd
   -- syntax error: mismatched input ï.ï expected LARROW

   instanceOfB <- (i. instanceOfb. instanceOfd).oclAsType(model2!D)
   --ClassCastException
 )
}

Which is the right way write the rule?

Thank you in advance.