Chapter 7: Intermediate representation and symbol table

. a name may denote several objects in the same block

- int x; struct x {float y, z; }

- lexical analyzer returns the name itself and not pointer to symbol table entry

- record in the symbol table is created when role of the name becomes clear

- in this case two symbol table entries will be created

. attributes of a name are entered in response to declarations

. labels are often identified by colon

. syntax of procedure/function specifies that certain identifiers are formals

. characters in a name

- there is a distinction between token id, lexeme and attributes of the names

- it is difficult to work with lexemes

- if there is modest upper bound on length then lexemes can be stored in symbol table

- if limit is large store lexemes separately

There might be multiple entries in the symbol table for the same name, all of them having different roles. It is quite intuitive that the symbol table entries have to be made only when the role of a particular name becomes clear. The lexical analyzer therefore just returns the name and not the symbol table entry as it cannot determine the context of that name. Attributes corresponding to the symbol table are entered for a name in response to the corresponding declaration. There has to be an upper limit for the length of the lexemes for them to be stored in the symbol table.