SlideShare a Scribd company logo
Compiler Construction
2
Texts:
Compiler Construction Principles and Practice
by Kenneth C. Louden
Compilers
by Afred, Jaffery Ulman
Introduction
3
4
A Compiler is a program that Reads one
Language (Source Code) and Translate it into
an equivalent another Language (Target Code)
CompilerSource Code Target Code
5
Source Code
usually in a high-level language,
e.g. C++, JAVA, VB, FORTAN, PASCAL, etc.
Target Code
usually in machine language (object code) or
assembly language (assembly code).
6
Thus a Compiler specifically is an executable
program that Reads a source code written in
usually some high-level language and Translates it
into an equivalent object code (machine language)
or assembly code (assembly language)
Compiler
code in
high-level
language
outputExecutable program
in machine language
executable program
in machine code or
assembly code
input
Definition
Complexity
A compiler may be a complex from program from
10,000 to 100,000 lines of source code.
7
Uses
compiler construction techniques have a large scope of
applications and these are used almost in every
field of computer sciences.
8
Our Task ?
Our task is to understand the basic organization,
structure and operations of a compiler.
9
Prerequisites
 Data Structures
 Discrete Mathematics
 Programming Languages
 Computer Architectures
 Assembly Languages
 Automata Theory (most helpful)
10
Design Issues
Programming Language Design issues are actually
Based on Language Design Issues so will discuss
the both ones.
11
Why Compiler ?
The Background
12
Machine Language
With the advent of Stored Program Computer in
late 1940’s by John Von Neumann, it was time
To write Computer Programs (sequence of steps),
that needed a Compiler to interpret these
Programs.
Initially these programs were written in the actual
Machine Codes.
exp.
Task: move a number 2 to memory location 0000.
Machine Code Instruction c7 06 0000 0002
13
Programming was much difficult in such language
thus a symbolic language was introduced, and that
language is called Assembly Language
exp.
Task: move a number 2 to memory location 0000.
Machine Code Instruction: c7 06 0000 0002
Assembly Code Instruction: move x , 2
where x is symbolic memory location.
14
Assembly Language
Machine Dependency
Difficult to Read (understand) & Write
15
Drawbacks
The next step in programming was the advent of
high level languages, exp.
Task: move a number 2 to memory location 0000.
Machine Code Instruction: c7 06 0000 0002
Assembly Code Instruction: move x , 2
High Level Instruction: x = 2 ;
16
High Level Language
Machine Independency
Easy to Read (understand) & Write
Close to human nature
mathematically & logically
17
Advantages
FORTRAN (1954 - 1957)
FORTRAN was the first high level language
developed in 195- 1954
Thus the first compiler for FORTRAN was
developed by the team at IBM led by John Backus
between 1954 and 1957.
18
Noam Chomsky
When the first compiler was under construction
during 195- 1954, Noam Chomsky was working on
the structure of Natural Languages
Chomsky’s research work also helped the
construction of first compiler.
19
Chomsky Hierarchy
Chomsky classified the languages according to the
complexity of their grammar
These Hierarchies are;
Type 0
Type 1
Type 2
Type 3
Where each next type is an advance form of their
previous type.
20
Parsing Problem
The next step in the development of compilers
was the study of parsing problem during 1960 to
1970,
During that study CFL and the problem to find out
efficient algorithms for the recognition of CFL
were studied.
21
Recent Work
Currently scientists are continuously working and
trying to find efficient methods of object code
generation. Its really difficult to generate truly
optimal code, but they only increase its efficiency.
Similarly work is being on the automation of
different phases, i.e., scanner generators, parser
Generators, etc.
22
Recent Work
Scientists are also working to develop
different sophisticated algorithms for pre analysis
of source code, like Unification Algorithm
Development of more enhanced and rich window
based IDE’s
Standardization of such environments.
etc,
23
(1) for development of new languages.
- language extensions & improvement
- more rich/formal specification of languages
- development of 4th generation languages
(2) for Standardization of Construction Process.
(3) for parallelizing compilers & related tools.
(4) for new development platforms.
24
Importance
(5) theories learned in this course are applicable to
other fields
e.g.,
prototyping tools,
database languages
text formatter
FSM (Finite State Machine) translator
query interpreter
command line interpreter
interface programs
Silicon Compilers, etc.
(6) for improving capabilities of existing
compiler/interpreter
25
Silicon compiler
- A silicon compiler is a software system that takes a
user's specifications and automatically generates an
integrated circuit (IC). The process is sometimes
referred to as hardware compilation.
- Source language: conventional programming
language
- Variables
Represents not the location but logical signals (0 or 1)
or groups of signals in a switching circuit.
- Output : circuit design in an appropriate language
26
Assignment # 1
27

More Related Content

What's hot

PROGRAMMING LANGUAGES
PROGRAMMING LANGUAGESPROGRAMMING LANGUAGES
PROGRAMMING LANGUAGES
ABHINAV SINGH
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
Akhilesh Maithani
 
Programming landuages
Programming landuagesProgramming landuages
Programming landuages
NataliaVasjuka
 
generation of programming language
 generation of programming language generation of programming language
generation of programming language
kunalkumar500
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq
 
Generations of Programming Languages
Generations of Programming LanguagesGenerations of Programming Languages
Generations of Programming Languages
jocleph
 
Programing Language
Programing LanguagePrograming Language
Programing Language
76 Degree Creative
 
Programming languages
Programming languagesProgramming languages
Programming languages
Simon Mui
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
Tarun Sharma
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
agorolabs
 
Theory of programming
Theory of programmingTheory of programming
Theory of programming
tcc_joemarie
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
sanjay joshi
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
Rajeshkumar Reddy
 
Program & language generation
Program & language generationProgram & language generation
Program & language generation
Buxoo Abdullah
 
Generations of Programming Languages
Generations of Programming LanguagesGenerations of Programming Languages
Generations of Programming Languages
Tarun Sharma
 
Evolution of Computer Languages
Evolution of Computer LanguagesEvolution of Computer Languages
Evolution of Computer Languages
Electro Computer Warehouse
 
Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1
lakshmi kumari neelapu
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
py7rjs
 
Presentation on Programming Languages.
Presentation on Programming Languages.Presentation on Programming Languages.
Presentation on Programming Languages.
Mohammad Shakirul islam
 

What's hot (20)

PROGRAMMING LANGUAGES
PROGRAMMING LANGUAGESPROGRAMMING LANGUAGES
PROGRAMMING LANGUAGES
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Programming landuages
Programming landuagesProgramming landuages
Programming landuages
 
generation of programming language
 generation of programming language generation of programming language
generation of programming language
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
Generations of Programming Languages
Generations of Programming LanguagesGenerations of Programming Languages
Generations of Programming Languages
 
Programing Language
Programing LanguagePrograming Language
Programing Language
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
Theory of programming
Theory of programmingTheory of programming
Theory of programming
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
Program & language generation
Program & language generationProgram & language generation
Program & language generation
 
Generations of Programming Languages
Generations of Programming LanguagesGenerations of Programming Languages
Generations of Programming Languages
 
Evolution of Computer Languages
Evolution of Computer LanguagesEvolution of Computer Languages
Evolution of Computer Languages
 
Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Generations Of Programming Languages
Generations Of Programming LanguagesGenerations Of Programming Languages
Generations Of Programming Languages
 
Presentation on Programming Languages.
Presentation on Programming Languages.Presentation on Programming Languages.
Presentation on Programming Languages.
 

Similar to Lecture # 1

all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programming
hamza239523
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
salmankhan570
 
Compiler Construction Lecture One .pptx
Compiler Construction Lecture One  .pptxCompiler Construction Lecture One  .pptx
Compiler Construction Lecture One .pptx
انشال عارف
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer Programming
Hussain Buksh
 
History of Computer Programming Languages.pptx
History of Computer Programming Languages.pptxHistory of Computer Programming Languages.pptx
History of Computer Programming Languages.pptx
AliAbbas906043
 
Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler development
DeepOad
 
English de lenguaje de programacion
English de lenguaje de programacionEnglish de lenguaje de programacion
English de lenguaje de programacion
Villalba Griselda
 
Programming languages
Programming languagesProgramming languages
Programming languages
Fatima Abdul Rahman
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
zaheeriqbal41
 
Introduction Programming Languages
Introduction Programming LanguagesIntroduction Programming Languages
Introduction Programming Languages
Manish Kharotia
 
Why-Kotlin definition to understand the use of kotin
Why-Kotlin definition to understand the use of kotinWhy-Kotlin definition to understand the use of kotin
Why-Kotlin definition to understand the use of kotin
sumanneupane23
 
Plc part 1
Plc part 1Plc part 1
Plc part 1
Taymoor Nazmy
 
Lesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptxLesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptx
DysRobles
 
Code learning
Code learningCode learning
Code learning
Vikas kumar
 
Programming lesson1
Programming lesson1Programming lesson1
Programming lesson1
camfollower
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptx
Subramanian Mani
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
Avinash Kapse
 
SS UI Lecture 1
SS UI Lecture 1SS UI Lecture 1
SS UI Lecture 1
Avinash Kapse
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Selvaraj Seerangan
 

Similar to Lecture # 1 (20)

all languages in computer programming
all languages in computer programmingall languages in computer programming
all languages in computer programming
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
Compiler Construction Lecture One .pptx
Compiler Construction Lecture One  .pptxCompiler Construction Lecture One  .pptx
Compiler Construction Lecture One .pptx
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer Programming
 
History of Computer Programming Languages.pptx
History of Computer Programming Languages.pptxHistory of Computer Programming Languages.pptx
History of Computer Programming Languages.pptx
 
Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler development
 
English de lenguaje de programacion
English de lenguaje de programacionEnglish de lenguaje de programacion
English de lenguaje de programacion
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Introduction to Computer
Introduction to ComputerIntroduction to Computer
Introduction to Computer
 
Introduction Programming Languages
Introduction Programming LanguagesIntroduction Programming Languages
Introduction Programming Languages
 
Why-Kotlin definition to understand the use of kotin
Why-Kotlin definition to understand the use of kotinWhy-Kotlin definition to understand the use of kotin
Why-Kotlin definition to understand the use of kotin
 
Plc part 1
Plc part 1Plc part 1
Plc part 1
 
Lesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptxLesson 1-3 Fundamentals of Programming.pptx
Lesson 1-3 Fundamentals of Programming.pptx
 
Code learning
Code learningCode learning
Code learning
 
Programming lesson1
Programming lesson1Programming lesson1
Programming lesson1
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptx
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
 
SS UI Lecture 1
SS UI Lecture 1SS UI Lecture 1
SS UI Lecture 1
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 

Recently uploaded

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 

Recently uploaded (20)

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 

Lecture # 1

  • 1.
  • 2. Compiler Construction 2 Texts: Compiler Construction Principles and Practice by Kenneth C. Louden Compilers by Afred, Jaffery Ulman
  • 4. 4 A Compiler is a program that Reads one Language (Source Code) and Translate it into an equivalent another Language (Target Code) CompilerSource Code Target Code
  • 5. 5 Source Code usually in a high-level language, e.g. C++, JAVA, VB, FORTAN, PASCAL, etc. Target Code usually in machine language (object code) or assembly language (assembly code).
  • 6. 6 Thus a Compiler specifically is an executable program that Reads a source code written in usually some high-level language and Translates it into an equivalent object code (machine language) or assembly code (assembly language) Compiler code in high-level language outputExecutable program in machine language executable program in machine code or assembly code input Definition
  • 7. Complexity A compiler may be a complex from program from 10,000 to 100,000 lines of source code. 7
  • 8. Uses compiler construction techniques have a large scope of applications and these are used almost in every field of computer sciences. 8
  • 9. Our Task ? Our task is to understand the basic organization, structure and operations of a compiler. 9
  • 10. Prerequisites  Data Structures  Discrete Mathematics  Programming Languages  Computer Architectures  Assembly Languages  Automata Theory (most helpful) 10
  • 11. Design Issues Programming Language Design issues are actually Based on Language Design Issues so will discuss the both ones. 11
  • 12. Why Compiler ? The Background 12
  • 13. Machine Language With the advent of Stored Program Computer in late 1940’s by John Von Neumann, it was time To write Computer Programs (sequence of steps), that needed a Compiler to interpret these Programs. Initially these programs were written in the actual Machine Codes. exp. Task: move a number 2 to memory location 0000. Machine Code Instruction c7 06 0000 0002 13
  • 14. Programming was much difficult in such language thus a symbolic language was introduced, and that language is called Assembly Language exp. Task: move a number 2 to memory location 0000. Machine Code Instruction: c7 06 0000 0002 Assembly Code Instruction: move x , 2 where x is symbolic memory location. 14 Assembly Language
  • 15. Machine Dependency Difficult to Read (understand) & Write 15 Drawbacks
  • 16. The next step in programming was the advent of high level languages, exp. Task: move a number 2 to memory location 0000. Machine Code Instruction: c7 06 0000 0002 Assembly Code Instruction: move x , 2 High Level Instruction: x = 2 ; 16 High Level Language
  • 17. Machine Independency Easy to Read (understand) & Write Close to human nature mathematically & logically 17 Advantages
  • 18. FORTRAN (1954 - 1957) FORTRAN was the first high level language developed in 195- 1954 Thus the first compiler for FORTRAN was developed by the team at IBM led by John Backus between 1954 and 1957. 18
  • 19. Noam Chomsky When the first compiler was under construction during 195- 1954, Noam Chomsky was working on the structure of Natural Languages Chomsky’s research work also helped the construction of first compiler. 19
  • 20. Chomsky Hierarchy Chomsky classified the languages according to the complexity of their grammar These Hierarchies are; Type 0 Type 1 Type 2 Type 3 Where each next type is an advance form of their previous type. 20
  • 21. Parsing Problem The next step in the development of compilers was the study of parsing problem during 1960 to 1970, During that study CFL and the problem to find out efficient algorithms for the recognition of CFL were studied. 21
  • 22. Recent Work Currently scientists are continuously working and trying to find efficient methods of object code generation. Its really difficult to generate truly optimal code, but they only increase its efficiency. Similarly work is being on the automation of different phases, i.e., scanner generators, parser Generators, etc. 22
  • 23. Recent Work Scientists are also working to develop different sophisticated algorithms for pre analysis of source code, like Unification Algorithm Development of more enhanced and rich window based IDE’s Standardization of such environments. etc, 23
  • 24. (1) for development of new languages. - language extensions & improvement - more rich/formal specification of languages - development of 4th generation languages (2) for Standardization of Construction Process. (3) for parallelizing compilers & related tools. (4) for new development platforms. 24 Importance
  • 25. (5) theories learned in this course are applicable to other fields e.g., prototyping tools, database languages text formatter FSM (Finite State Machine) translator query interpreter command line interpreter interface programs Silicon Compilers, etc. (6) for improving capabilities of existing compiler/interpreter 25
  • 26. Silicon compiler - A silicon compiler is a software system that takes a user's specifications and automatically generates an integrated circuit (IC). The process is sometimes referred to as hardware compilation. - Source language: conventional programming language - Variables Represents not the location but logical signals (0 or 1) or groups of signals in a switching circuit. - Output : circuit design in an appropriate language 26