home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / oberon-a-1.4ß.lha / Oberon-A / texts / InternalData.txt < prev    next >
Text File  |  1994-06-18  |  6KB  |  151 lines

  1.      $RCSfile: InternalData.txt $
  2.   Description: Description of internal data structures used by the compiler
  3.  
  4.    Created by: fjc (Frank Copeland)
  5.     $Revision: 1.3 $
  6.       $Author: fjc $
  7.         $Date: 1994/06/14 00:51:35 $
  8.  
  9.   Copyright © 1994, Frank Copeland.
  10.   This file is part of Oberon-A.
  11.   See Oberon-A.doc for conditions of use and distribution.
  12.   ________________________________________________________________________
  13.  
  14.   [WARNING: this document has not been kept properly up to date]
  15.  
  16.   INTRODUCTION
  17.  
  18.   This document describes the internal data structures used by the
  19.   Oberon-A compiler.  It should be read with reference to section 12.3 of
  20.   Project Oberon (1).  This document presents the modifications made in
  21.   porting the compiler from the NS32x32 processors to the MC68000.
  22.  
  23.   OBJECT AND ITEM MODES
  24.  
  25.   Object modes - basic modes of declared identifiers.
  26.  
  27.   Var         Variable (global and local variable, value parameters)
  28.   Ind         Indirect (variable parameters)
  29.   Con         Constant
  30.   Fld         Record field
  31.   Typ         User defined and basic types
  32.   LProc       Local procedure
  33.   XProc       Exportable procedure
  34.   SProc       Standard procedure
  35.   LibCall     Amiga library function definition
  36.   IProc       Interrupt handler procedure
  37.   Mod         Module
  38.   Head        Head of list of objects
  39.  
  40.   Item modes - non-basic modes generated in expressions.
  41.  
  42.   Reg         direct register mode (intermediate result in expression)
  43.   RegI        indirect register mode (dereferencing pointers, variable
  44.               parameters)
  45.   RegX        indirect, indexed register mode (access to array element in
  46.               expression)
  47.   Stk         stack mode (procedure parameters, saved registers)
  48.   Coc         condition code mode (evaluation of boolean expressions (?))
  49.   Abs         absolute mode (?)
  50.  
  51.   DATA STRUCTURE ALIASES
  52.  
  53.   The Object, Item and Struct types used in the symbol table are actually
  54.   variant records.  For the sake of simplicity and portability (and
  55.   because the Oberon language does not have variant record types) these
  56.   types have a number of anonymous fields that are interpreted according
  57.   to  the mode or form field of the record.
  58.  
  59.   Table 12.2 (modified)
  60.   --------+------------------+-----------------------------
  61.           | Objects          | Items
  62.   mode    | a0    a1    a2   | lev   a0    a1    a2    obj
  63.   --------+------------------+-----------------------------
  64.   Var     | adr   rcvr       | lev   adr
  65.   VarX    |                  | lev   adr         RX
  66.   VarR    | R                | lev   R
  67.   Ind     | adr   rcvr       | lev   adr   off
  68.   IndX    |                  | lev   adr   off   RX
  69.   IndR    | R                | lev   R
  70.   Con     | val   val        |       val   val
  71.           | sadr  leng  mno  | mno   sadr  leng  mno        (strings)
  72.   RegI    |                  |       R     off
  73.   RegX    |                  |       R     off   RX
  74.   Lab     |                  |       off   size
  75.   LabI    |                  |       off   size
  76.   Push    |                  |       R
  77.   Pop     |                  |       R
  78.   Coc     |                  |       CC    Tjmp  Fjmp
  79.   Brnch   |                  |
  80.   Reg     |                  |       R
  81.   Fld     | off              |       off               obj
  82.   Typ     |                  | mno   tadr              obj
  83.   LProc   | pno         fwd  | lev   pno               obj
  84.   XProc   |             fwd  | mno                     obj
  85.   TProc   | pno   tlev  fwd  | mno   pno   tlev  super obj
  86.   SProc   | fno              |       fno
  87.   Mod     | mno   key        |       mno               obj
  88.   Head    | lev   psize      |
  89.   LibCall | foff             | foff                    obj
  90.  
  91.   --------+----------------------
  92.           | Objects
  93.   mode    | left  right  link
  94.   --------+----------------------
  95.   Var     |              next
  96.   VarX    |              next
  97.   VarR    |              next
  98.   Ind     |              next
  99.   IndX    |              next
  100.   IndR    |              next
  101.   LProc   |              pars
  102.   XProc   |              pars
  103.   TProc   | next         pars
  104.   Head    | next  vars   objects
  105.   LibCall | next         pars
  106.   Fld     | next
  107.  
  108.   -------------------------------------------------
  109.   Structures
  110.   form      BaseTyp   link    mno   n       adr
  111.   -------------------------------------------------
  112.   Pointer   PBaseTyp
  113.   ProcTyp   ResTyp    param
  114.   Array     ElemTyp           mno   nofel
  115.   DynArr    ElemTyp
  116.   Record    BaseTyp   fields  mno   tlev    descno
  117.  
  118.   Explanation of field names
  119.  
  120.   adr      - base address of object
  121.   lev      - lexical level of declaration
  122.   obj      - back pointer to object structure for item
  123.   off      - offset from base address or register
  124.   RX       - register number of index register
  125.   R        - register number
  126.   val      - value of constant (longreals use both a0 and a1, others only a0)
  127.   sadr     - base address of string constant
  128.   leng     - length of string constant
  129.   CC       - condition code number
  130.   Tjmp     - address of code executed if expression result is TRUE
  131.   Fjmp     - address of code executed if expression result is FALSE
  132.   mno      - module number
  133.   tadr     - address of record type descriptor (?)
  134.   pars     - list of procedure parameters
  135.   pno      - procedure number
  136.   Ladr     - address of procedure code
  137.   fno      - standard procedure number
  138.   psize    - no idea :-)
  139.   PBaseTyp - pointer base type
  140.   ResTyp   - procedure result type
  141.   param    - list of procedure parameters
  142.   ElemTyp  - array element type
  143.   nofel    - number of elements in array
  144.   bounds   - address of array bounds constant
  145.   BaseTyp  - record base type
  146.   fields   - list of record fields
  147.   descno   - record type descripter number
  148.   foff     - library vector offset of function
  149.   size     - size of reference: 1 - byte, 2 = word, 4 = long
  150.   tlev     - inheritance level of record type
  151.