SlideShare a Scribd company logo
1 of 18
System Software (5KS03)
Unit 1 : Introduction to Compiling
Lecture : 1 Introduction to Compiling:
Phases of a compiler,
A S Kapse,
Assistant Professor,
Department Of Computer Sci. & Engineering
Anuradha Engineering College, Chikhli
Contents…
 Introduction to Compilers
Objectives…
 Upon completion of this lecture, you will be able
 To understand the basics Compiler
 To understand analysis and synthesis.
 To understand use and purpose of compiler
Review…./ Concepts
 What do you mean by Software?
 What do you mean by Operating System?
 What do you mean by system?
 What do you mean by compiler?
Introduction to Compilers
 As a Discipline, Involves Multiple CS&E Areas
 Programming Languages and Algorithms
 Theory of Computing & Software Engineering
 Computer Architecture & Operating Systems
 Has Deceivingly Simplistic Intent:
Compiler
Source
program
Target
Program
Error messages
Diverse & Varied
Classifications of Compilers
 Compilers Viewed from Many Perspectives
 However, All utilize same basic tasks to accomplish
their actions
Single Pass
Multiple Pass
Load & Go
Construction
Debugging
Optimizing
Functional
The Model
 The TWO Fundamental Parts:
 We Will Discuss Both in This Class, and
FOCUS on analysis.
Analysis:
Synthesis:
Decompose Source into an
intermediate representation
Target program generation
from representation
Important Notes
 Today: There are many Software Tools for helping with
the Analysis Part. This Wasn’t the Case in Early Days.
(some) analysis is also important in:
 Structure / Syntax directed editors: Force
“syntactically” correct code to be entered
 Pretty Printers: Standardized version for program
structure (i.e., blank space, indenting, etc.)
 Static Checkers: A “quick” compilation to detect
rudimentary errors
 Interpreters: “real” time execution of code a “line-at-a-
time”
Important Notes
 Compilation Is Not Limited to Programming Language
Applications
 Text Formatters
 LATEX & TROFF Are Languages Whose Commands
Format Text
 Silicon Compilers
 Textual / Graphical: Take Input and Generate Circuit Design
 Database Query Processors
 Database Query Languages Are Also a Programming Language
 Input is compiled Into a Set of Operations for Accessing the
Database
Overview and History (1)
 Cause
 Software for early computers was written in assembly language
 The benefits of reusing software on different CPUs started to
become significantly greater than the cost of writing a compiler
 The first real compiler
 FORTRAN compilers of the late 1950s
 18 person-years to build
10
Overview and History (2)
11
 Compiler technology
 is more broadly applicable and has been employed in
rather unexpected areas.
 Text-formatting languages,
like nroff and troff; preprocessor packages like eqn, tbl, pic
 Silicon compiler for the creation of VLSI circuits
 Command languages of OS
 Query languages of Database systems
What Do Compilers Do (1)
12
 A compiler acts as a translator,
transforming human-oriented programming languages
into computer-oriented machine languages.
 Ignore machine-dependent details for programmer
Programming
Language
(Source)
Compiler
Machine
Language
(Target)
What Do Compilers Do (2)
 Compilers may generate three types of code:
 Pure Machine Code
 Machine instruction set without assuming the existence of any
operating system or library.
 Mostly being OS or embedded applications.
 Augmented Machine Code
 Code with OS routines and runtime support routines.
 More often
 Virtual Machine Code
 Virtual instructions, can be run on any architecture with a virtual
machine interpreter or a just-in-time compiler
 Ex. Java
13
What Do Compilers Do (3)
 Another way that compilers
differ from one another is in the format of the target
machine code they generate:
 Assembly or other source format
 Relocatable binary
 Relative address
 A linkage step is required
 Absolute binary
 Absolute address
 Can be executed directly
14
15
 Any compiler must perform two major tasks
 Analysis of the source program
 Synthesis of a machine-language program
The Structure of a Compiler (1)
Compiler
Analysis Synthesis
Video
1. Introduction to Compiler.
Questions..
1. Define Compiler?
Homework..
1. What is Analysis and synthesis?

More Related Content

What's hot (19)

compiler and their types
compiler and their typescompiler and their types
compiler and their types
 
Compiler Design Quiz
Compiler Design QuizCompiler Design Quiz
Compiler Design Quiz
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Language translator
Language translatorLanguage translator
Language translator
 
Compiler
Compiler Compiler
Compiler
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
2 c++ programming languages
2 c++   programming languages2 c++   programming languages
2 c++ programming languages
 
Compilation v. interpretation
Compilation v. interpretationCompilation v. interpretation
Compilation v. interpretation
 
Compiler type
Compiler typeCompiler type
Compiler type
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler design
 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
 
Assembler
AssemblerAssembler
Assembler
 
Compiler design
Compiler designCompiler design
Compiler design
 
df
dfdf
df
 
Compilers
CompilersCompilers
Compilers
 
Compiler design
Compiler designCompiler design
Compiler design
 
Compiler.design.in.c.docs
Compiler.design.in.c.docsCompiler.design.in.c.docs
Compiler.design.in.c.docs
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)
 

Viewers also liked

Viewers also liked (6)

Ss ui lecture 2
Ss ui lecture 2Ss ui lecture 2
Ss ui lecture 2
 
Compiler construction
Compiler constructionCompiler construction
Compiler construction
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
phases of compiler-analysis phase
phases of compiler-analysis phasephases of compiler-analysis phase
phases of compiler-analysis phase
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
 

Similar to SS UI Lecture 1

Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic conceptsAbdul Khan
 
Ch 1.pptx
Ch 1.pptxCh 1.pptx
Ch 1.pptxwoldu2
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfDrIsikoIsaac
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introductionRana Ehtisham Ul Haq
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxdawod yimer
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptxAshenafiGirma5
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introductionmengistu23
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxZiyadMohammed17
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilersAftab Ahmad
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfDrIsikoIsaac
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and developmentAli Raza
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdfKINGZzofYouTube
 
Chapter One
Chapter OneChapter One
Chapter Onebolovv
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design BasicsAkhil Kaushik
 

Similar to SS UI Lecture 1 (20)

Cd unit i
Cd unit iCd unit i
Cd unit i
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Ch 1.pptx
Ch 1.pptxCh 1.pptx
Ch 1.pptx
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
WEBSITE DEVELOPMENT
WEBSITE DEVELOPMENTWEBSITE DEVELOPMENT
WEBSITE DEVELOPMENT
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
 
Lecture1 compilers
Lecture1 compilersLecture1 compilers
Lecture1 compilers
 
Chap01-Intro.ppt
Chap01-Intro.pptChap01-Intro.ppt
Chap01-Intro.ppt
 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
 
Chapter One
Chapter OneChapter One
Chapter One
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 

More from Avinash Kapse

More from Avinash Kapse (8)

Presentation1
Presentation1Presentation1
Presentation1
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Presentation1
Presentation1Presentation1
Presentation1
 
SS UII Lecture 1
SS UII Lecture 1SS UII Lecture 1
SS UII Lecture 1
 
SS UI Lecture 5
SS UI Lecture 5SS UI Lecture 5
SS UI Lecture 5
 
SS UI Lecture 6
SS UI Lecture 6SS UI Lecture 6
SS UI Lecture 6
 
SS UI Lecture 4
SS UI Lecture 4SS UI Lecture 4
SS UI Lecture 4
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
 

SS UI Lecture 1

  • 1. System Software (5KS03) Unit 1 : Introduction to Compiling Lecture : 1 Introduction to Compiling: Phases of a compiler, A S Kapse, Assistant Professor, Department Of Computer Sci. & Engineering Anuradha Engineering College, Chikhli
  • 3. Objectives…  Upon completion of this lecture, you will be able  To understand the basics Compiler  To understand analysis and synthesis.  To understand use and purpose of compiler
  • 4. Review…./ Concepts  What do you mean by Software?  What do you mean by Operating System?  What do you mean by system?  What do you mean by compiler?
  • 5. Introduction to Compilers  As a Discipline, Involves Multiple CS&E Areas  Programming Languages and Algorithms  Theory of Computing & Software Engineering  Computer Architecture & Operating Systems  Has Deceivingly Simplistic Intent: Compiler Source program Target Program Error messages Diverse & Varied
  • 6. Classifications of Compilers  Compilers Viewed from Many Perspectives  However, All utilize same basic tasks to accomplish their actions Single Pass Multiple Pass Load & Go Construction Debugging Optimizing Functional
  • 7. The Model  The TWO Fundamental Parts:  We Will Discuss Both in This Class, and FOCUS on analysis. Analysis: Synthesis: Decompose Source into an intermediate representation Target program generation from representation
  • 8. Important Notes  Today: There are many Software Tools for helping with the Analysis Part. This Wasn’t the Case in Early Days. (some) analysis is also important in:  Structure / Syntax directed editors: Force “syntactically” correct code to be entered  Pretty Printers: Standardized version for program structure (i.e., blank space, indenting, etc.)  Static Checkers: A “quick” compilation to detect rudimentary errors  Interpreters: “real” time execution of code a “line-at-a- time”
  • 9. Important Notes  Compilation Is Not Limited to Programming Language Applications  Text Formatters  LATEX & TROFF Are Languages Whose Commands Format Text  Silicon Compilers  Textual / Graphical: Take Input and Generate Circuit Design  Database Query Processors  Database Query Languages Are Also a Programming Language  Input is compiled Into a Set of Operations for Accessing the Database
  • 10. Overview and History (1)  Cause  Software for early computers was written in assembly language  The benefits of reusing software on different CPUs started to become significantly greater than the cost of writing a compiler  The first real compiler  FORTRAN compilers of the late 1950s  18 person-years to build 10
  • 11. Overview and History (2) 11  Compiler technology  is more broadly applicable and has been employed in rather unexpected areas.  Text-formatting languages, like nroff and troff; preprocessor packages like eqn, tbl, pic  Silicon compiler for the creation of VLSI circuits  Command languages of OS  Query languages of Database systems
  • 12. What Do Compilers Do (1) 12  A compiler acts as a translator, transforming human-oriented programming languages into computer-oriented machine languages.  Ignore machine-dependent details for programmer Programming Language (Source) Compiler Machine Language (Target)
  • 13. What Do Compilers Do (2)  Compilers may generate three types of code:  Pure Machine Code  Machine instruction set without assuming the existence of any operating system or library.  Mostly being OS or embedded applications.  Augmented Machine Code  Code with OS routines and runtime support routines.  More often  Virtual Machine Code  Virtual instructions, can be run on any architecture with a virtual machine interpreter or a just-in-time compiler  Ex. Java 13
  • 14. What Do Compilers Do (3)  Another way that compilers differ from one another is in the format of the target machine code they generate:  Assembly or other source format  Relocatable binary  Relative address  A linkage step is required  Absolute binary  Absolute address  Can be executed directly 14
  • 15. 15  Any compiler must perform two major tasks  Analysis of the source program  Synthesis of a machine-language program The Structure of a Compiler (1) Compiler Analysis Synthesis
  • 18. Homework.. 1. What is Analysis and synthesis?