Lecture 1 CC
Lecture 1 CC
(CS-636)
1
Outline
2
Introduction to the Course
Compiler Construction
CS-636
3
Course Introduction
4
Course Objectives
5
Organization of the Course
Theoretical
This part will be covered through lectures delivered
with the help of slides during class meetings
Presentation
Students will be given a topic to prepare a brief
presentation. The presentation will be scheduled in the
later part of the semester
Project
Implementation of Lexical Analyzer and Parser of C++
OR Java will be required from the students
6
Topics to be Covered
Compiler introduction
Organization of compilers
Background / Revision of Automata Concepts
Lexical analysis
Syntax analysis
Parsing techniques
Object code generation and optimization
Detection and recovery from errors
Advanced Topics
7
Pre-requisites & Evaluation
Pre-requisites
Automata Theory
Computer Programming
Evaluation
Mid-term Exam 12%
Quizzes, Assignments, & Project 8%
Final Theory 20%
Final Practical 20%
8
Introduction to Compiler
Lecture: 1
9
What is a Compiler?
Compiler is a tool:
which translate notations from one system to
10
What is a Compiler? (Continue…)
11
What is Involved in Compilers?
Programming Languages
Formal Languages
Regular Expressions & Automata Theory
Applications
Programming Languages ?
We use natural languages to communicate
We use programming languages to speak with
computers
12
Why Compiler?
13
Brief History of Compiler
The first compiler was developed between 1954 and
1957
The FORTRAN language and its compiler by a team at
IBM led by John Backus
The structure of natural language was studied at about
the same time by Noam Chomsky
Chomsky classified languages according to the
complexity of their grammar
Chomsky’s Hierarchy, as it is now called have four levels
of grammar type 0, 1, 2, and 3
The type 2 or context free grammar is considered the
most useful for programming languages
14
Brief History of Compiler (Continue…)
Recent advances in compiler design
More sophisticated algorithms for inferring and/or
simplifying the information contained in program,
such as the unification algorithm of Hindley-Milner
type checking
Window-based Interactive Development
Environment
IDE that includes editors, linkers, debuggers, and
project managers
However, the basic of compiler design have not
changed much in the last 50+ years
15
Files Involved in Compiler
Operations
A source code text file (.c, .cpp, .java, etc. file
extensions)
Intermediate code files: transformations of
source code during compilation, usually kept in
temporary files rarely seen by the user
An assembly code text file containing symbolic
machine code, often produced as the output of a
compiler (.asm, .s file extensions)
16
Files Involved in Compiler
Operations
(Continue…)
One or more binary object code files:
machine instructions, not yet linked or
executable (.obj, .o file extensions)
A binary executable file: linked,
independently executable (well, not
always…) code (.exe, .out extensions, or no
extension)
17
Summary
Any Questions?
18