Caine, Farber & Gordon, Inc.
 
Home
General
Contact Us
PDL/81
Compilers
 

The PDL Language


In this section we examine The PDL language is a combination of English and PDL Keywords. English provides the richness and the variety the designer is used to using; the keywords add the means to specify structure and avoid ambiguity.

Keywords

The primary PDL keywords, grouped as commonly used, are:

ifdoreturn
elseifundo
elsecycle
endifenddo

The secondary keywords are:

ifwhileforevercase
untilfornot

The set of keywords can be easily modified by the designer. In addition, there is a set of keywords specific to the Ada language.

In Example 1, notice how easily a PDL design of a simple bubble sort can be understood from just a quick reading.

Flow Segments

The overall structure of a PDL design is formed by dividing it into Flow Segments. A Flow Segment corresponds roughly to a procedure in the final implementation. A typical design comprises a hierarchy of Flow Segments in which a main segment references others, which in turn reference others.

Writing PDL

The mechanics of writing in PDL are simple. A design is written to a source file using any text editor. Having entered the the name of a Flow segment, the PDL statements that compose it are entered in free form. Then the problem of presenting the design in a high-standard, cross-referenced Design Document is left entirely to the PDL/81 Processor.

Example 2 is a generated flow segment taken from a typical PDL/81 design document. Example 3 is an extract from the source file showing exactly what was written by the designer.

Examples

Example 1. PDL/81 Design of a Bubble Sort
sort(table, number of items)

IF there are any items
    DO UNTIL no items are interchanged
        DO FOR each pair of items in the table (1-2, 2-3,
                3-4, etc.)
            IF first item of pair is greater than second item of pair
                interchange the two items
            ENDIF
        ENDDO
    ENDDO
ENDIF
Back

Example 2. A Page From a PDL/81 Design Document

CFG, INC.    PHASE 50: CROSS-REFERENCE (42.90)                   PAGE 11
28 Sep 91    Cross-Reference Phase

   Move Names Out of Symbol Entries

REF   (CX=2)
PAGE **********************************************************************
     *                                                                    *
     *  1  DO FOR each symbol entry ..all hang in sorted order from first *
     *         hash entry                                                 *
  14 *  2    allocate a block () returns (address)                        *
     *  3    IF free_space_overrun                                        *
     *  4      reset print flag                                           *
  20 *  5      print line (symbol names overran free space; no cross-     *
     *             reference displayed)                                   *
     *  6      UNDO                                                       *
     *  7    ELSE                                                         *
     *  8      move dictionary_name from symbol entry to address          *
     *  9      replace first word of name in symbol entry with address    *
     *             ..xref_name pointer                                    *
     * 10      replace second word of name in symbol entry with zero      *
     *             ..xref_block_pointer                                   *
     * 11      replace third word of name in symbol entry with zero       *
     *             ..xref_count                                           *
     * 12    ENDIF                                                        *
     * 13  ENDDO FOR                                                       *
     *                                                                    *
     **********************************************************************

     Requirements 3.4.1.2, 3.4.6
Back

Example 3: The Corresponding Extract From the Source File

%s Move Names Out of Symbol Entries
%r 3.4.1.2;3.4.6
do for each symbol entry ..all hang in sorted order from the first \
      hash table entry
  allocate a block () returns (address)
  if free_space_overrun
    reset print flag
      print line (symbol names overran free space; no cross-reference \
          displayed)
      undo
  else
    move dictionary_name from symbol entry to address
    replace first word of name in symbol entry with address ..xref_name pointer
    replace second word of name in symbol entry with zero ..xref_block_pointer
    replace third word of name in symbol entry with zero ..xref_count
  endif
endo for
Back

CFG Home Page   |   PDL/81 Home Page   |   Start of PDL/81 Intro   |   Previous   |   Next

Copyright © 1991 Caine, Farber & Gordon, Inc.


Home | General | What's New
PDL/81 | Compilers
Contact the Webmaster


Caine, Farber & Gordon, Inc.
tel: (626) 449-3070 - (800) 424-3070 - fax: (626) 440-1742
1010 E Union St Ste 205, Pasadena, CA 91106