Setting stereotype of an UML element [message #60087] |
Fri, 17 July 2009 12:29  |
Eclipse User |
|
|
|
Hi @all,
my grammar imports the uml metamodel and contains following rule:
MyClass returns umlMM::Class: 'className' name=ID;
Is it possible to set the stereotype of the class element? If yes, which
steps are required to do that?
Thanks
ILyas
|
|
|
|
|
|
Re: Setting stereotype of an UML element [message #61303 is a reply to message #61278] |
Mon, 20 July 2009 10:08   |
Eclipse User |
|
|
|
Hi Ilyas,
I think a M2M transformation is your way to go. Other opportunities like
implementing a custom IAstFactory require in-depth knowledge about the
framework and its internals and are likely to cause trouble with the
serialization as they will break the bidirectionality of the parser and
the serializer.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 20.07.2009 15:52 Uhr, schrieb Ilyas Keser:
> Hi @all,
>
> I defined an UML profile with 3 stereotypes: <<Window>>, <<InputField>>
> and <<Button>>. In this profile a window can contain input fields and
> buttons. I defined a simple grammar:
>
> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>
> import "http://www.eclipse.org/uml2/3.0.0/UML" as umlMM
>
> generate myDsl "http://www.xtext.org/example/MyDsl"
>
> ....
>
> Window:
> 'Window' name=ID '{'
> (inputFields+=InputField)*
> (buttons+=Button)*
> '}';
>
> InputField:
> 'Input' name=ID;
>
> Button:
> 'Button' name=ID;
>
> Just, I want that the rule Window returns a class and apply the
> stereotype <<Window>>. To do that, the rule should return umlMM::Class:
>
> Window returns umlMM::Class:
> 'Window' name=ID '{'
> (inputFields+=InputField)*
> (buttons+=Button)*
> '}';
>
> Logically, this is not possible, because: "Cannot find compatible
> feature inputFields in sealed EClass Class from imported package
> http://www.eclipse.org/uml2/3.0.0/UML."
>
> Is it possible define a window rule which returns umlMM::Class and owns
> additional features. Or do I need a M2M transformation? Any ideas?
>
>
> Thanks
> ILyas
|
|
|
Re: Setting stereotype of an UML element [message #62182 is a reply to message #61303] |
Tue, 21 July 2009 18:57  |
Eclipse User |
|
|
|
Hi Sebastian,
thanks for your answer. I will try to use M2M transformations.
Regards,
ILyas
Sebastian Zarnekow schrieb:
> Hi Ilyas,
>
> I think a M2M transformation is your way to go. Other opportunities like
> implementing a custom IAstFactory require in-depth knowledge about the
> framework and its internals and are likely to cause trouble with the
> serialization as they will break the bidirectionality of the parser and
> the serializer.
>
> Regards,
> Sebastian
|
|
|
Powered by
FUDForum. Page generated in 0.07645 seconds