Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » Bug or me ??
Bug or me ?? [message #380491] Tue, 04 December 2007 18:19 Go to next message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 83
Registered: July 2009
Member
Hi all,

Maybe i'm wrong but i've noticed a problem when writing a tcs. Here's a
simple metamodel that denotes my problem:

abstract class A {}
class B extends A {}
class C extends B {}

and the corresponding TCS

template A abstract;
template B
: "B" ...
;
template C
: "C" ...
;

But at injection execution the class C is not recognized ?
If i change my metamodel like this:

abstract class A {}
class B extends A {}
class C extends A {}

then the injection goes well !!
Where i'm wrong ?

Regards.
[TCS] Re: Bug or me ?? [message #380492 is a reply to message #380491] Tue, 04 December 2007 18:20 Go to previous messageGo to next message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 83
Registered: July 2009
Member
Forgot the [TCS]
Re: [TCS] Bug or me ?? [message #380493 is a reply to message #380491] Tue, 04 December 2007 20:09 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Guillaume,


> Maybe i'm wrong but i've noticed a problem when writing a tcs. Here's a
> simple metamodel that denotes my problem:
>
> abstract class A {}
> class B extends A {}
> class C extends B {}
>
> and the corresponding TCS
>
> template A abstract;
> template B : "B" ...
> ;
> template C
> : "C" ...
> ;
>
> But at injection execution the class C is not recognized ?
> If i change my metamodel like this:
>
> abstract class A {}
> class B extends A {}
> class C extends A {}
>
> then the injection goes well !!
> Where i'm wrong ?

The "abstract" keyword alone only considers direct subclasses.

The following should work:

template A abstract;
template B abstract -- ask TCS to consider B subclasses
: "B" ...
;
template C
: "C" ...
;



The following may work (please tell us if it does for you):

template A deep abstract; -- ask TCS to consider "all"
-- of A subclasses
template B
: "B" ...
;
template C
: "C" ...
;


Regards,

Frédéric Jouault
Re: [TCS] Bug or me ?? [message #380496 is a reply to message #380493] Wed, 05 December 2007 14:02 Go to previous message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 83
Registered: July 2009
Member
Hi,

Both methods are working for me.

Thanks

> The following should work:

> template A abstract;
> template B abstract -- ask TCS to consider B subclasses
> : "B" ...
> ;
> template C
> : "C" ...
> ;

> The following may work (please tell us if it does for you):

> template A deep abstract; -- ask TCS to consider "all"
> -- of A subclasses
> template B
> : "B" ...
> ;
> template C
> : "C" ...
> ;


> Regards,

> Frédéric Jouault
[TCS] Re: Bug or me ?? [message #610995 is a reply to message #380491] Tue, 04 December 2007 18:20 Go to previous message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 83
Registered: July 2009
Member
Forgot the [TCS]
Re: [TCS] Bug or me ?? [message #610997 is a reply to message #380491] Tue, 04 December 2007 20:09 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Guillaume,


> Maybe i'm wrong but i've noticed a problem when writing a tcs. Here's a
> simple metamodel that denotes my problem:
>
> abstract class A {}
> class B extends A {}
> class C extends B {}
>
> and the corresponding TCS
>
> template A abstract;
> template B : "B" ...
> ;
> template C
> : "C" ...
> ;
>
> But at injection execution the class C is not recognized ?
> If i change my metamodel like this:
>
> abstract class A {}
> class B extends A {}
> class C extends A {}
>
> then the injection goes well !!
> Where i'm wrong ?

The "abstract" keyword alone only considers direct subclasses.

The following should work:

template A abstract;
template B abstract -- ask TCS to consider B subclasses
: "B" ...
;
template C
: "C" ...
;



The following may work (please tell us if it does for you):

template A deep abstract; -- ask TCS to consider "all"
-- of A subclasses
template B
: "B" ...
;
template C
: "C" ...
;


Regards,

Frédéric Jouault
Re: [TCS] Bug or me ?? [message #611003 is a reply to message #380493] Wed, 05 December 2007 14:02 Go to previous message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 83
Registered: July 2009
Member
Hi,

Both methods are working for me.

Thanks

> The following should work:

> template A abstract;
> template B abstract -- ask TCS to consider B subclasses
> : "B" ...
> ;
> template C
> : "C" ...
> ;

> The following may work (please tell us if it does for you):

> template A deep abstract; -- ask TCS to consider "all"
> -- of A subclasses
> template B
> : "B" ...
> ;
> template C
> : "C" ...
> ;


> Regards,

> Frédéric Jouault
Previous Topic:[TCS] Type checking: KM3+TCS or ATL
Next Topic:[TCS] Type checking: KM3+TCS or ATL
Goto Forum:
  


Current Time: Sun Dec 21 05:34:49 GMT 2014

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

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