[comp.lang.ada] internal and external representation of data

Michael.Rissman@SEI.CMU.EDU (03/10/89)

Hello moderator:

A while ago the bboard addressed the intrnal representation of enumeration
types, values of which are stored externally.  We have solved the problem for 
enumeration types and integers.  Please post the description of the software
which follows:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Systems such as C3 systems typically receive information in some external
format selected to facilitate communication across narrow bandwidths.  For
example, Incoming messages must be validated and processed.  External
formats are not necessarily convenient to process, and make it difficult to
assure syntactic validity.  Furthermore, external formats are arcane and
difficult for humans to comprehend.   When the hardware architecture is
heterogeneous, even typed information from one machine must be treated as an
"external format" on another.

The Software Engineering Institute (SEI) has created a set of Ada generics
and Ada code templates which provide functionality to convert between
symbolic images (external representations) and Ada types, and between
natural images (user-friendly representations) and Ada types.

Instantiations  called typecasters can be used:

  * to translate and validate incoming messages,  

  * to check and format messages input by users, 

  * to retrieve information from files in which information is stored as
    byte-arrays or strings, and

  * to localize information on the format of outgoing messages.  

Each Ada generic addresses a typical relationship between an external format
and a set of discrete values constituting an Ada type, subtype or derived
type.  The generics do *not* require the use of representation clauses to map
between external and internal values.  

Composite types are addressed by Ada code templates.  A code template is
provided for records, arrays, optional values, and for interdependent
values.  All templates export identical services.

Templates  are instantiated manually by textual substitution.  Test drivers
are appended to the templates, and are instantiated by the same
substitutions needed to instantiate  the templates.

The typecasters have been tested on actual C3 programs.  The typecasters 
meet the functional and performance  requirements of those programs.  

We are writing a report explaining the design and use of the typecasters.
Chuck Plinta is the principal author, with assistance from  Ken Lee and Rich
D'Ipollito. The report  will be ready in a few months.  We plan to make the
software as available  as possible when the report is released.


If you're interested in this approach, let us know.  Indicate the kinds of
applications and problems for which you are interested in the typecasters.
Please include the name of your organization and your phone number.  Do so
by filling in the electronic form below and mailing it to Michael Rissman at
mmr@sei.cmu.edu.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The name of your orgainization:

Your name:

Your email address:

Your postal address:

Your telephone number:

Application domains and problems which spur your interest: