comp.lang.ada
 help / color / mirror / Atom feed
* Re: Classic-Ada
@ 1991-07-17 14:08 Frank Pappas
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Pappas @ 1991-07-17 14:08 UTC (permalink / raw)


  A recent posting asked for information about Classic-Ada. Here's
the contact information:

              Software Productivity Solutions
              (407) 984-3370

I reviewed the product in the November 1990 issue of IEEE's Computer.
I liked the product then and I know that they were making
improvements at the time. The only thing I disliked about it was the
documentation, which was pretty bad (but not impossible to use).
Again, I'm sure they have improved it by now.

  Coincidentally, someone called me last week asking how to convert
C++ source to Ada source.  His company had C++ source that it wanted
to rewrite in Ada. (I didn't ask why). I suggested that the best
approach was to redesign the code in Ada, but if that wasn't
feasible, he should look at Classic-Ada.

  Classic-Ada provides OOP extensions to Ada, with full Ada still
available. The Classic-Ada preprocessor accepts Classic-Ada source
and produces pure Ada source. The preprocessed source must then be
compiled with an Ada compiler. Classic-Ada also generates an
``executive'' (which takes care of dynamic binding) that must be
compiled with the pure Ada source.

  I reviewed Classic-Ada under 386 Unix. Looking at the pure Ada
generated by the preprocessor, it seems that you could use
Classic-Ada under Unix to write ``objected-oriented Ada'', produce
the pure Ada, and then compile the pure Ada, including the
``executive'', under MSDOS, VMS, etc. Of course, that assumes you
don't program in any Unix dependencies.

  At the time I reviewed Classic-Ada, the preprocessor performed
syntactic and semantic checking of the Classic-Ada extensions only.
Checking of standard Ada features was left to the target compiler.
That's not the most productive way to compile, and there's some
obvious potential awkwardness, but it didn't seem to be that
troublesome. As for consistency of class interfaces, Classic-Ada has
a program library similar in use to an Ada program library.

  Before giving an example of Classic-Ada source, a couple points
about the Classic-Ada extensions and their mapping to pure Ada.
Classes are mapped to packages and methods to subprograms. As already
mentioned, dynamic binding is handled by an ``executive''.

  The following example comes from the Computer review, which is
based on an example from their manuals. If you want details about it
look at the review. Also, I seem to recall that the company includes
an article or two on Classic-Ada with their sales information.

  If anyone from Software Productivity Solutions sees this posting,
let us know if any significant errors exist in the example or in the
posting itself. If any other vendors have OOP front-ends for Ada,
please let me know about your product by sending e-mail directly
to me. 


      -- A class specification in Classic-Ada --


WITH Tactical_Type; USE Tactical_Types;
CLASS Radar IS

  SUPERCLASS Fixed_Object;

  METHOD Create (New_Radar : OUT Object_ID);

  INSTANCE METHOD In_Range (Penetrator : Object_ID);
  INSTANCE METHOD Transmit_Message (Message : String; Penetrator : Object_ID);
  INSTANCE METHOD Out_Of_Range (Penetrator : Object_ID);

  INSTANCE METHOD Initialize;

END Radar;

      -- An example of inheritance in Classic-Ada --

CLASS Sam IS

  SUPERCLASS Radar;

  METHOD Create (New_Sam: OUT Object_ID);

  INSTANCE METHOD Add_Penetrator    (A_Penetrator    : Object_ID);
  INSTANCE METHOD Remove_Penetrator (A_Penetrator    : Object_ID);
  INSTANCE METHOD Expect            (This_Penetrator : Object_ID);

  INSTANCE METHOD Initialize;

END Sam;

WITH Tactical_Types;  USE Tactical_Type;
WITH Penetrator_List; USE Penetrator_List;
CLASS BODY Sam IS

  Max_Shots             : INSTANCE Integer;
  Possible_Penetrators  : INSTANCE Fighter_List;
  Alert_Delay           : INSTANCE Integer;

  METHOD Create (New_Sam : OUT Object_ID) IS
  BEGIN
    New_Sam := INSTANTIATE;
    SEND (New_Sam, Initialize);
  END Create;


  INSTANCE METHOD Add_Penetrator (A_Penetrator : Object_ID) IS
  BEGIN
    Add_To_List (A_Penetrator, Possible_Penetrators);
  END Add_Penetrator;


  INSTANCE METHOD Remove_Penetrator (A_Penetrator : Object_ID) IS
  BEGIN
    Remove_From_List (A_Penetrator, Possible_Penetrators);
  END Remove_Penetrator;


  INSTANCE METHOD Expect (This_Penetrator : Object_ID) IS
  BEGIN
    Status := Alert;
    SEND (SELF, Add_Penetrator, A_Penetrator => This_Penetrator);
  END Expect;


  INSTANCE METHOD Initialize IS
  BEGIN
    Max_Shots := 4;
    Possible_Penetrators := null;
    Alert_Delay := 10;
    SEND (SUPER, Initialize);
  END Initialize;

END Sam;


====================================================================
INTERNET: fpappas@mcimail.com                  PHONE: (215) 789-3206
====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Classic-Ada
@ 1991-07-18 15:22 Bud Bach
  0 siblings, 0 replies; 2+ messages in thread
From: Bud Bach @ 1991-07-18 15:22 UTC (permalink / raw)


0004238973@MCIMAIL.COM (Frank Pappas) writes:

>  A recent posting asked for information about Classic-Ada. 
> [...]
>  At the time I reviewed Classic-Ada, the preprocessor performed
>syntactic and semantic checking of the Classic-Ada extensions only.

Actually it does full Ada lexical and syntax analysis.  I wrote the lexer
and helped build the parser :).  The parser is implemented using ayacc from
UCI and the Ada grammer written by Herm Fischer.  It is true that it
only does semantic analysis on the extensions.

One of the more interesting new features is persistent objects.  Also SPS
has made significant improvements in the run-time performance.  Off the top
of my head, message sends were down to 2.5 times the performance of a
procedure call last time I worked with it.

As for related products, there is a European product called Dragoon and I
believe a proprietary tool that Harris Corp. has implemented.

Nice review.  -- Bud
-- 
Bud Bach - Consultant				c/o Motorola
708 632-6611					Cellular Infrastructure Group
...!uunet!motcid!bachww or			1501 W. Shure Drive, MS-1239
bachww%motcid@uunet.uu.net			Arlington Heights, IL  60004

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-07-18 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-07-18 15:22 Classic-Ada Bud Bach
  -- strict thread matches above, loose matches on Subject: below --
1991-07-17 14:08 Classic-Ada Frank Pappas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox