Contents    Page-10    Prev    Next    Page+10    Index   

Record Declarations

A record declaration has a form such as:
record field1, ... , fieldn : type1 ; ... end
Such a declaration is processed as follows:

  1. Initialize offset within the record to be 0.

  2. For each entry group,
    1. Find the symbol table entry for the type .

    2. Allocate storage within the record using the storage allocation algorithm and size of type .

    3. Make a symbol table entry for each field, filling in its print name, type, offset in the record, and size.

    4. Link the entries for the fields to an entry for the record.

  3. The size of the record is the total size given by the storage allocation algorithm, rounded up to whole words, e.g. multiple of 8.

  4. Variant records simply restart the storage allocation at the place where the variant part begins. Total size is the maximum size of the variants.