INF5110 – Compiler Construction
Symbol tables Spring 2016
1 / 43
INF5110 Compiler Construction Symbol tables Spring 2016 1 / 43 - - PowerPoint PPT Presentation
INF5110 Compiler Construction Symbol tables Spring 2016 1 / 43 Outline 1. Symbol tables Introduction Symbol table design an interface Implementing symbol tables Block-structure, scoping, binding, name-space organization Symbol tables
1 / 43
2 / 43
3 / 43
4 / 43
5 / 43
6 / 43
1Neither conceptually nor the way it’s implemented. 7 / 43
8 / 43
9 / 43
2Also the language used for implementation (and the availability of libraries
10 / 43
11 / 43
12 / 43
3There is alternative terminology (cf. INF2220), under which separate
13 / 43
14 / 43
15 / 43
16 / 43
17 / 43
18 / 43
4One may say: one symbol table per block, because the form of
19 / 43
20 / 43
5The notion of static links will be encountered later again when dealing with
21 / 43
22 / 43
6Besides that, class names are subject to scoping themselves, of course. 23 / 43
24 / 43
25 / 43
26 / 43
27 / 43
28 / 43
1
2
3
4
5
6
7
8
9
10
11
12
13 14
15
16
29 / 43
1
2
3
4
5
6
7
8
9
10
11
12
13 14
15
16
30 / 43
31 / 43
32 / 43
33 / 43
34 / 43
35 / 43
36 / 43
aRealistically, more info would be stored as well (types etc) 37 / 43
7I would not have recommended doing it like that (though it works) 38 / 43
39 / 43
40 / 43
41 / 43