Professional Documents
Culture Documents
Lecture 1: Introduction
Waheed Noor
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
In this Course:
You will learn how the compiler works.
Learn about compiler structure & types, lexical analyzer, syntax
analyzer, semantic analyzer and other major components in
compiler construction.
Assignments after each unit. (Late assignments will not be
accepted.)
Plagiarism is an academic offense, zero marks will be given if
found in your assignments.
Random Quiz any day any time during class.
Waheed Noor (CS&IT, UoB, Quetta) CS406-Compiler Construction November 2013 4 / 26
Books & Materials
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
Error Messages
Figure : A Compiler
Target Program
The target program that is the output of a compiler can also be in a
variety of form such as another programming language, relocatable
object program, assembly language and machine language of a
microprocessor.
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
Definition
The synthesis part constructs the desired target program from the
intermediate representation.
This part synthesis the target program depending on the goal of the
compilation. For example, a compiler may first generate and
intermediate code after analysis, and then generate the target code
that can be assembly language code or machine code.
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
2 What is a Compiler
3 Historical Overview
6 Goals of Compilers
Assembler
Assembler translates the generated assembly language code
generated by the compiler into the machine code.
*References