Professional Documents
Culture Documents
Compiler Construction
[SWE-310]
Introduction
1
8/5/2020
2
8/5/2020
3
8/5/2020
Assembler:
Assembler
4
8/5/2020
5
8/5/2020
Compiler
Error Messages
6
8/5/2020
7
8/5/2020
Why Interpretation?
• A higher degree of machine independence: high
portability.
• Dynamic execution: modification or addition to
user programs as execution proceeds.
• Dynamic data type: type of object may change
at runtime
• Easier to write: no synthesis part.
• Better diagnostics: more source text
information available
Compilation Process:
Interpretive Process:
8
8/5/2020
Compilation Process:
Interpretive Process:
9
8/5/2020
10
8/5/2020
Synthesis
Analysis
Code Code
Lexical Syntactic Semantic
Generator optimizer
Analysis Analysis Analysis
Tables
11
8/5/2020
Pretty Printers:
Analyzes a program and prints it in such a
way that the structure of program becomes
clearly visible.
i.e. Indentation
12
8/5/2020
Static Checkers:
Reads a program, analyzes it and attempts
to discover potential bugs without running
the program.
E.g. Parts of source program that can
never be executed and using variables
without being defining them.
Works on dry run techniques.
The End
13