Introduction
The global symbol table stores information pertaining to all the global variables and functions in an ExpL program.
Global Symbol Table
The global symbol table stores information pertaining to all the global variables and functions in an ExpL program.
The structure of Global Symbol Table(GST) is as follows:
✛NOTE: flabel is a placeholder for the starting address of the function's code in memory. Any call to the function must translate into an assembly level call to this address. When the compiler makes the symbol table entry for a function during function declaration, the actual starting address is not determined, and instead a pseudo address is assigned to flabel. A call to the function will be initially translated by the compiler to a call to this pseudo address. The actual memory address will be determined later (often in a separate pass) and the compiler will replace all pseudo labels with the correct addresses. Here, we assume that the compiler assigns for each function a unique integer in the flabel field of the global symbol table as its function identifier or "pseudo-address". Thus, the pseudo-address can be used to identify the function during the label translation phase. When the compiler generates code, more human readable labels like F0, F1, F2, F3, ... are assigned to functions whose flabel field is set to pseudo-addresses 0, 1,2,3,...
Paramlist is used to store information regarding the types and names of the parameters. ParamStruct has the following structure.
Continuing with earlier example, let us add Global declaration section to it.