Contents    Page-10    Prev    Next    Page+10    Index   

Variable Declarations

A variable declaration has a form such as:

var var1, var2, ..., varn : type ;
Such a declaration is processed as follows:
  1. Find the symbol table entry for type .

  2. For each variable vari ,
    1. Allocate storage within the current block using the storage allocation algorithm and the size of type .

    2. Make a symbol table entry for the variable, filling in its print name, type, offset, size, and block level.

    3. Enter the symbol in the symbol table for the current block.