From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c17e6ae73bd8c51 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!postnews.google.com!k17g2000prf.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Ada and UML Date: Fri, 3 Sep 2010 06:18:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <156c1bf7-8744-43a0-b620-017244d4763d@k17g2000prf.googlegroups.com> References: <4c7f5735$0$6766$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 77.198.58.12 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283519918 31420 127.0.0.1 (3 Sep 2010 13:18:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Sep 2010 13:18:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k17g2000prf.googlegroups.com; posting-host=77.198.58.12; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.80 (Windows NT 5.1; U; fr) Presto/2.6.30 Version/10.61,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13930 Date: 2010-09-03T06:18:38-07:00 List-Id: On 3 sep, 06:19, Yannick Duch=EAne (Hibou57) wrote: > No, that is solved. You can do Ada with it Here is a tiny example, just to show to people with curiosity. This lack many and many things, this is just to show. First, the Model to Text transformation. It is able to generate a package with contained classes implemented as records whose full view is private. Methods which are not of UML public visibility are declared in the Ada package private part, the others, in the public part. Generate the *.ads source only. <%metamodel http://www.eclipse.org/uml2/2.0.0/UML%> <%script type=3D"uml.NamedElement" name=3D"asTypeName" post=3D"trim()"%> <%args(0).name%>_Type <%script type=3D"uml.Operation" name=3D"asParameterList" post=3D"trim()"%> Self : <%asTypeName(args(0).parent())%> <%if (eAllContents("Parameter")) {%> <%for (eAllContents("Parameter")) {%> <%if (!name.equalsIgnoreCase("return")) {%> ; <%name%> : <%asTypeName(type)%> <%}%> <%}%> <%}%>) <%script type=3D"uml.Operation" name=3D"asSignature" post=3D"trim()"%> <%if (type =3D=3D "") {%> procedure <%name%> ( <%asParameterList(current)%>; <%}else{%> function <%name%> ( <%asParameterList(current)%> return <%asTypeName(type)%>; <%}%> <%script type=3D"uml.Package" name=3D"Generator_1" file=3D"<%name%>.ads" %> package <%name%> is <%for (eAllContents("Class")) {%> type <%asTypeName(current)%> is private; <%for (eAllContents("Operation")) {%> <%if (visibility =3D=3D "public") {%> <%asSignature(current)%> <%}%> <%}%> <%}%> private <%for (eAllContents("Class")) {%> type <%asTypeName(current)%> is record <%for (eAllContents("Property")) {%> <%name%> : <%asTypeName(type)%>; <%}%> end record; -- <%asTypeName(current)%> <%for (eAllContents("Operation")) {%> <%if (visibility !=3D "public") {%> <%asSignature(current)%> <%}%> <%}%> <%}%> end <%name%>; Then, a sample UML model it can be applied to (to access XML source of a model, just access it as a text file): Your three cents here. Sample output. Note that I did not work the generated source formating ; I know it's ugly. package Greetings is type Greeting_Box_Type is private; procedure Say_Hi ( Self : Greeting_Box_Type ); procedure Set_Greeting_Counter ( Self : Greeting_Box_Type ; Value : Natural_Type ); function Get_Greeting_Counter ( Self : Greeting_Box_Type ) return Natural_Type; private type Greeting_Box_Type is record Greating_Counter : Natural_Type; end record; -- Greeting_Box_Type procedure Have_A_Private_Time ( Self : Greeting_Box_Type ); end Greetings; Has a taste of both ASIS (due to semantic access of an UML "source") and XSLT (due to transform). Never seen like this before. There may be provision to generate full source when an implementation is a pure state machine. At least, this is able to generate a more or less detailed skeleton, but with a better view on the overall types + tagged + packages architecture/cooperation and probably more. The limitation I feel: not as much easy and clean to access UML diagrams semantic this way as it is to access Ada sources semantic using ASIS. May be this is partly due to the script-like language which is involved. Well, any one can now push Ada in UML shops (or perhaps this is UML pushing in an Ada shop, lol) How does it work with HOOD ? Does it work the same way ?