Data Structure Descriptions

The Automatic Programming Server produces versions of generic procedures that are specialized for your data structures. This document tells how to describe your data structures to the system.

When you start the Automatic Programming Server, it creates a window containing an input area and a command menu. Click the mouse in the input area, then enter the description of your data; the input editor is an Emacs subset. After the description of your data structure is complete, click the mouse outside the input area; the system will respond with a confirming message. Repeat the process as needed to define other data types.

Data Descriptions for C, C++, Java, and Pascal

A parenthesized, Lisp-like data description language is used for all of these languages. The system will generate appropriate declarations in the target language for use if desired.

If the desired type is a basic type, only the basic type name needs to be specified. The basic types are:

If a view such as avl-tree is selected when the user type is a basic type, the system will define an appropriate carrier record containing that type as its contents.

A record is described by the form: (name   fields) where a field is (name   type) . A pointer to a type is denoted (^     type)

An example data declaration for a person data structure that could be viewed as a linked list is:

(person (name   string)
        (age    integer)
        (salary real)
        (friend (^ person)))

Data Descriptions for Lisp

A Lisp data description has the basic form: (name   type)

A type is either a type name or a structuring operator applied to types. The basic types are:

The structuring operators are:

An example data declaration for a person data structure in Lisp is:

(person (list (name   string)
              (age    integer)
              (salary real)
              (friend (^ person))))