Re: ANN: Ada source code decorator



Simon Wright wrote:

"Martin Krischik" <krischik@xxxxxxxxxxxxxxxxxxxxx> writes:

Manuel Collado wrote:

That's my case. I would love an ASIS export utility that provides
the full ASIS-accesible information about a single compilation unit
as a single XML document.

And I would like that format to be XMI [1]. What good woul be any
XML format when there are tools which can read it.

Martin

[1] http://en.wikipedia.org/wiki/XMI

I'm not at all sure that XMI is capable of representing _all_ of an
Ada program without extensions. And you would certainly have to make
some mapping decisions.

In the reverse direction, given a UML model, are you going to map a
Class to a package? to a tagged type? Either would be valid ... (and
would have its own difficulties).

UML has both Classes and Packages. If I was to make an UML <-> Ada mapping
then packages are mapped to Packages and type/subtype is mapped to Classes.

Unadorned Classes would become tagged types while adorned Classes could
become any other Ada type. Like (use an unproportional font for what
follows):

+-------------------+
| <<range>> Integer |
+-------------------+
^
|
| <<subtype>>
|
+-------------------------+
| <<range>> Day |
+-------------------------+
| First : Integer := 1 |
| Last : Integer := 31 |
+-------------------------+

Would become:

subtype Day is Integer range 1 .. 31;

and

+---------------+
| <<range>> Day |
+---------------+
| First := 1 |
| Last := 31 |
| Size := 8 |
+---------------+

Would become:

type Day is new range 1 .. 31;
For Day'Size use 8;

I think that this a full natural way of mapping Ada <-> UML - After all
'First and 'Last are called Attributes on both sides. And if you continue
the way of stereotypes then you can map all Ada feature to UML.

Martin
--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.



Relevant Pages

  • Re: Question about OO programming in Ada
    ... book "Programming in Ada 95" that I ordered a couple of days ago. ... types, if I really them, inside the private part of the packages affected. ... What's the optimal way in Ada to do this? ... Like in any language, getting a grasp of the language features ...
    (comp.lang.ada)
  • Re: Help writing ada booting kernel
    ... That was quite a time-consuming approach, I guess I'll leave it in assembly code for the time being until it's getting necessary to change it:) Thanks for your detailed suggestion anyway. ... Rewrite the bootloader aka the asm packages in ada. ... As for another kernel type of sample type the Toy_Lovelace packages 1..6. ... Also it is based on the SimpleOS (SOS) version written in C/Assembly so if you know C you can learn from looking a both set of packages and programs. ...
    (comp.lang.ada)
  • 2 Ada 95/05 language design questions
    ... I find Ada to be an excellent embedded, real-time, OO language. ... tagged type to be declared in the same or child packages than to have ... reference has to be repeated every time the classwide subprogram is ... they have a child derived type view of the object. ...
    (comp.lang.ada)
  • Re: Dont use the "use" clause
    ... > and date package that uses routines from standard Ada packages. ... You may be like many engineers dumped into a project needing Ada ... Most compilers are going to have trouble browsing to the ...
    (comp.lang.ada)
  • Re: Generate UML Models From Ada Code
    ... Studio all reverse Ada too. ... >major upgrade of WinTranslator that adds the capability of scanning Ada ... >source code and generating graphic UML class models in WinA&D. ... >WinTranslator is a reengineering tool that works with Excel Software's ...
    (comp.object)