INF5110 – Compiler Construction
Spring 2017
1 / 45
INF5110 Compiler Construction Spring 2017 1 / 45 Outline 1. - - PowerPoint PPT Presentation
INF5110 Compiler Construction Spring 2017 1 / 45 Outline 1. Symbol tables Introduction Symbol table design and interface Implementing symbol tables Block-structure, scoping, binding, name-space organization Symbol tables as attributes
1 / 45
2 / 45
3 / 45
4 / 45
5 / 45
1Remember the (general) notion of “attribute”. 6 / 45
7 / 45
8 / 45
2Neither conceptually nor the way it’s implemented. 9 / 45
10 / 45
11 / 45
3Also the language used for implementation (and the availability of libraries
12 / 45
13 / 45
14 / 45
4There exists alternative terminology (cf. INF2220), under which separate
15 / 45
16 / 45
17 / 45
18 / 45
19 / 45
20 / 45
5One may say: one symbol table per block, as this form of organization can
21 / 45
22 / 45
6The notion of static links will be encountered later again when dealing with
23 / 45
24 / 45
7Besides that, class names themselves are subject to scoping themselves, of
25 / 45
26 / 45
27 / 45
28 / 45
29 / 45
30 / 45
1
2
3
4
5
6
7
8
9
10
11
12
13 14
15
16
31 / 45
1
2
3
4
5
6
7
8
9
10
11
12
13 14
15
16
32 / 45
33 / 45
34 / 45
35 / 45
36 / 45
37 / 45
38 / 45
aRealistically, more info would be stored, as well (types etc) 39 / 45
8I would not have recommended doing it like that (though it works) 40 / 45
41 / 45
42 / 45
43 / 45
44 / 45
[Appel, 1998] Appel, A. W. (1998). Modern Compiler Implementation in ML/Java/C. Cambridge University Press. [Louden, 1997] Louden, K. (1997). Compiler Construction, Principles and Practice. PWS Publishing. 45 / 45