Compiler construction
Martin Steffen March 13, 2017
Contents
1 Abstract 1 1.1 Symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 Symbol table design and interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.3 Implementing symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.4 Block-structure, scoping, binding, name-space organization . . . . . . . . . . . . . . 7 1.1.5 Symbol tables as attributes in an AG . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Reference 14
1 Abstract
Abstract This is the handout version of the slides. It contains basically the same content, only in a way which allows more compact printing. Sometimes, the overlays, which make sense in a presentation, are not fully rendered here. Besides the material of the slides, the handout versions may also contain additional remarks and background information which may or may not be helpful in getting the bigger picture.
1.1 Symbol tables
- 6. 3. 2017
1.1.1 Introduction Symbol tables, in general
- central data structure
- “data base” or repository associating properties with “names” (identifiers, symbols)1
- declarations
– constants – type declarationss – variable declarations – procedure declarations – class declarations – . . .
- declaring occurrences vs. use occurrences of names (e.g. variables)
1Remember the (general) notion of “attribute”.