INF5110 – Compiler Construction
Spring 2017
1 / 93
INF5110 Compiler Construction Spring 2017 1 / 93 Outline 1. - - PowerPoint PPT Presentation
INF5110 Compiler Construction Spring 2017 1 / 93 Outline 1. Grammars Introduction Context-free grammars and BNF notation Ambiguity Syntax diagrams Chomsky hierarchy Syntax of Tiny References 2 / 93 INF5110 Compiler Construction
1 / 93
2 / 93
3 / 93
4 / 93
5 / 93
6 / 93
7 / 93
8 / 93
9 / 93
10 / 93
aand some say, regular expressions describe its microsyntax.
11 / 93
12 / 93
13 / 93
1The grammar can be seen as consisting of 6 productions/rules, 3 for expr
14 / 93
15 / 93
16 / 93
17 / 93
2We’ll come back to that later, it will be important. 18 / 93
19 / 93
20 / 93
3There will be abstract syntax trees, as well. 21 / 93
3There will be abstract syntax trees, as well. 22 / 93
3There will be abstract syntax trees, as well. 23 / 93
3There will be abstract syntax trees, as well. 24 / 93
3There will be abstract syntax trees, as well. 25 / 93
3There will be abstract syntax trees, as well. 26 / 93
3There will be abstract syntax trees, as well. 27 / 93
28 / 93
29 / 93
30 / 93
31 / 93
32 / 93
33 / 93
34 / 93
35 / 93
36 / 93
37 / 93
38 / 93
39 / 93
40 / 93
41 / 93
42 / 93
43 / 93
44 / 93
45 / 93
46 / 93
47 / 93
48 / 93
49 / 93
50 / 93
51 / 93
52 / 93
53 / 93
54 / 93
55 / 93
56 / 93
57 / 93
58 / 93
4At least in many cases. 59 / 93
4At least in many cases. 60 / 93
61 / 93
62 / 93
63 / 93
64 / 93
65 / 93
66 / 93
67 / 93
68 / 93
69 / 93
70 / 93
71 / 93
72 / 93
73 / 93
74 / 93
75 / 93
76 / 93
77 / 93
78 / 93
79 / 93
80 / 93
81 / 93
82 / 93
83 / 93
84 / 93
85 / 93
86 / 93
87 / 93
88 / 93
89 / 93
90 / 93
91 / 93
92 / 93
[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. 93 / 93