7.3 ENTERING INFORMATION INTO THE SYMBOL TABLE


7.2 IMPLEMENTATION

Each entry in a symbol table can be implemented as a record that consists of several fields. These fields are dependent on the information to be saved about the name. But since the information about a name depends on the usage of the name (i.e., on the program element identified by the name), the entries in the symbol table records will not be uniform. Hence, to keep the symbol table records uniform, some of the information about the name is kept outside of the symbol table record, and a pointer to this information is stored in the symbol table record, as shown in Figure 7.1. Here, the information about the lower and upper bounds of the dimension of the array named a is kept outside of the symbol table record, and the pointer to this information is stored within the symbol table record.

click to expand
Figure 7.1: A pointer steers the symbol table to remotely stored information for the array a.



Algorithms for Compiler Design
Algorithms for Compiler Design (Electrical and Computer Engineering Series)
ISBN: 1584501006
EAN: 2147483647
Year: 2005
Pages: 108
Authors: O G Kakde

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net