SlideShare une entreprise Scribd logo
1  sur  42
UNIT-III
Programming Language
• Lexical and Syntactic features of a
  programming Language are specified by its
  grammar
• Language:- collection of valid sentences.
• Sentences: These are the sequence of words.
• Word:- Sequence of letters of graphic symbols.
• The Language specified in this manner is
  called as formal Language.
Programming Language Grammar
• A formal Language is a set of rules which
  precisely specify the sentence of L.
• Formal Grammar can be represented as :-
• G= {∑ , NT, S, P}
  – ∑ set of terminals
  – NT set of non terminals
  – S Distinguished symbol (Starting symbol)
  – P set of productions.
• Terminal Symbol:- These are the symbols
  which can not further sub divided
  – Ex:- ∑= { a, b,c,d…….0,1,2,3……}
• No terminal symbols:- These are the
  combination of terminal symbols which can be
  further sub divided.
  – Ex:- <A> or <Noun>
• Production :- It is called as re-writing rule
• It can be represented as :-
   – Each production consists of a No terminal
     followed by an arrow (-) or equal to
     (=), followed by string of Non terminals and
     terminals
   – Ex:- A  b
          S  Aa
Syntax Tree


• A Graphical representation of any statement
  of a Language is called as syntax tree.
id+id*id



id
Derivation
• The replacement of Non terminal symbols
  according to the given production rule is
  called as derivation
• Types of Derivation:
  – Leftmost derivation
  – Rightmost derivation
Rules for English Language
1)   <Sentence>  <NP><VP>
2)   <NP>        <article><noun>
3)   <VP>        <verb>
4)   <VP>        <verb><adverb>
5)   <article>   The
6)   <noun>      student
7)   <verb>      studies
8)   <adverb>  hard
9)   <adverb>  slowly
Derivation
•   Structure                        Rules applied
•   <Sentence>
•   <NP><VP>                                  (1)
•   <article><noun>< VP>                      (2)
•   <article><noun> <verb><adverb>            (4)
•   The <noun> <verb><adverb>                 (5)
•   The student <verb> <adverb>               (6)
•   The student studies <adverb>              (7)
•   The student studies hard                  (8)
• Ex. Consider the full grammar,
•     E → E+E
•     E → E*E
•     E → id
•     Let us derive the string “ id + id * id”
Using leftmost derivation:-
Using Right most derivation:-
Rules
Required string is bbaa
• Derive the string

  –babbaaaba
Required string is




   baab
Reduction
• It is the process of replacement of string or
  part of string by non terminal according to the
  production rule.
•   Structure                       Rules applied
•   The student studies hard
•   <article> student studies hard            (5)
•   <article><noun> studies hard             (6)
•   <article><noun> <verb> hard              (7)
•   <article><noun> <verb> <adverb>          (8)
•   <NP> <verb> <adverb>                     (2)
•   <NP><VP>                                 (4)
•   <Sentence>                               (1)
Ambiguity of Grammar
• The Grammar for a language is said to be
  ambiguous if there exists at least one string
  which can be generated (or, derived) in more
  than one way
• i. e. there can be more than one leftmost
  derivations, more than one rightmost
  derivations & also more than one derivation
  trees associated with such a string.
• Ex. Consider the full grammar,
•     E → E+E
•     E → E*E
•     E → id
•     Let us derive the string “ id + id * id”
id   id
Compiler
• Complier:-
     • These are the system programs which will
       automatically translate the High level language
       program in to the machine language program

Source program                                 Target program /
High level Lang.           Compiler            M/C Lang. Prog.
Prog.



                           Database
• Cross Compiler:-
     • These are the system programs which will automatically
       translate the HLL program compatible with M/C A, in to the
       machine language program compatible with M/C A , but the
       underlying M/C is M/C B
Source program                                      Target program /
HLL Prog.                   Cross Compiler          M/C Lang. Prog.
Compatible with
M/C A



                               M/C B
P Code Compiler
 Source
Program


Compiler     P-Code interpreter



  Obj
Program



Exexute     P-Code interpreter
• Very similar in concept of Interpreter
• In pseudo- code complier program is analyzed
  and converted into an intermediate form,
  which is then executed interpretively.
• The source program is compiled, the resulted
  object program is in p-code. This p-code
  program is then read and executed under
  control of p-code interpreter.
Compilation process overview
• Compilation process is vast and complex.
• Hence it is divided into a series of subtasks
  called as phases.
• Each of which transform the source program
  form one representation to another.
• The compilation process involves two major
  tasks.
Compilation process overview

Analysis of   +    Synthesis of   =   Translation
source text       Target text         of prog in
                                      obj form
• Analysis of source text
  – Lexical Analysis (Scanner)
  – Syntax Analysis (Parser)
  – Semantic analysis.


• Synthesis of target text
  – Storage allocation
  – Code generation
Analysis of source text

• Determine validity of source statement from
  the analysis view point.
• Determine the content of source statement.
• Construct the suitable representation of the
  source statement f0r use by the subsequent
  analysis phase or by the synthesis phase of
  compiler.
Synthesis of target text

• Memory allocation:- It is the simple task given to
  the presence of symbol table. The memory
  requirement of an identifier is computed from its
  length, type and dimension and memory is
  allocated to it.
• Code generation:- the code generation uses the
  knowledge of target architecture , knowledge of
  instruction and also the addressing modes in the
  target computer to select the appropriate
  instruction.
Synthesis of target text

• The important issues in code generation are
  – Determine the space where the intermediate
    results should ne kept i.e. whether they should be
    kept in memory location or held in machine
    register.
  – Determine which instruction should be used for
    type conversion operation.
  – Determine which addressing mode should be
    used.
Phase Structure of Compiler
Code Optimization
• This is an optional phase to improve the
  intermediate code so that ultimate object
  program can run faster and also take less phase.
•     The ultimate aim of this technique is to
  improve the execution efficiency of a program by
  – Eliminating redundancies
  – Rearranging the computation in the program with out
    affecting target machine.
Code optimization techniques

1.   Compile time evaluation
2.   Elimination of common sub expressions
3.   Frequency reduction
4.   Strength reduction
5.   Dead code elimination
6.   Boolean sub expressions optimization
7.   Local and Global optimization.

Contenu connexe

Tendances

Compiler Design
Compiler DesignCompiler Design
Compiler DesignMir Majid
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costslalithambiga kamaraj
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignKuppusamy P
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsingkunj desai
 
Programming team structure
Programming team structureProgramming team structure
Programming team structureNancyBeaulah_R
 
Planning the development process
Planning the development processPlanning the development process
Planning the development processSiva Priya
 
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)Dhrumil Panchal
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineeringkirupasuchi1996
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processorshindept123
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction Sarmad Ali
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysisBilalzafar22
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation TechniquesMohamedIbrahim1408
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design MAHASREEM
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquesSiva Priya
 

Tendances (20)

Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
System engineering
System engineeringSystem engineering
System engineering
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsing
 
Programming team structure
Programming team structureProgramming team structure
Programming team structure
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction
 
COCOMO model
COCOMO modelCOCOMO model
COCOMO model
 
Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 

Similaire à System Programming Unit III

Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02riddhi viradiya
 
Experiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine TranslationExperiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine Translationkhyati gupta
 
Experiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine TranslationExperiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine Translationkhyati gupta
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processorsRebaz Najeeb
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdfKalighatOkira
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler ConstructionAhmed Raza
 
Compier Design_Unit I.ppt
Compier Design_Unit I.pptCompier Design_Unit I.ppt
Compier Design_Unit I.pptsivaganesh293
 
Compier Design_Unit I.ppt
Compier Design_Unit I.pptCompier Design_Unit I.ppt
Compier Design_Unit I.pptsivaganesh293
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design BasicsAkhil Kaushik
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compilerAbha Damani
 
Compier Design_Unit I_SRM.ppt
Compier Design_Unit I_SRM.pptCompier Design_Unit I_SRM.ppt
Compier Design_Unit I_SRM.pptApoorv Diwan
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design BasicsAkhil Kaushik
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction Thapar Institute
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptxAshenafiGirma5
 

Similaire à System Programming Unit III (20)

Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02Unit iii-111206004501-phpapp02
Unit iii-111206004501-phpapp02
 
1 cc
1 cc1 cc
1 cc
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Experiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine TranslationExperiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine Translation
 
Experiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine TranslationExperiments with Different Models of Statistcial Machine Translation
Experiments with Different Models of Statistcial Machine Translation
 
project present
project presentproject present
project present
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
1 compiler outline
1 compiler outline1 compiler outline
1 compiler outline
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
 
Compier Design_Unit I.ppt
Compier Design_Unit I.pptCompier Design_Unit I.ppt
Compier Design_Unit I.ppt
 
Compier Design_Unit I.ppt
Compier Design_Unit I.pptCompier Design_Unit I.ppt
Compier Design_Unit I.ppt
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
Compier Design_Unit I_SRM.ppt
Compier Design_Unit I_SRM.pptCompier Design_Unit I_SRM.ppt
Compier Design_Unit I_SRM.ppt
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
COMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptxCOMPILER DESIGN PPTS.pptx
COMPILER DESIGN PPTS.pptx
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 

Plus de Manoj Patil

System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IVManoj Patil
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit IIManoj Patil
 

Plus de Manoj Patil (9)

Smqa unit ii
Smqa unit   iiSmqa unit   ii
Smqa unit ii
 
Smqa unit v
Smqa unit v Smqa unit v
Smqa unit v
 
Smqa unit iv
Smqa unit iv Smqa unit iv
Smqa unit iv
 
Smqa unit ii
Smqa unit iiSmqa unit ii
Smqa unit ii
 
Smqa unit i
Smqa unit iSmqa unit i
Smqa unit i
 
Smqa unit iii
Smqa unit iiiSmqa unit iii
Smqa unit iii
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IV
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 

Dernier

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Dernier (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

System Programming Unit III

  • 2. Programming Language • Lexical and Syntactic features of a programming Language are specified by its grammar • Language:- collection of valid sentences. • Sentences: These are the sequence of words. • Word:- Sequence of letters of graphic symbols. • The Language specified in this manner is called as formal Language.
  • 3. Programming Language Grammar • A formal Language is a set of rules which precisely specify the sentence of L. • Formal Grammar can be represented as :- • G= {∑ , NT, S, P} – ∑ set of terminals – NT set of non terminals – S Distinguished symbol (Starting symbol) – P set of productions.
  • 4. • Terminal Symbol:- These are the symbols which can not further sub divided – Ex:- ∑= { a, b,c,d…….0,1,2,3……} • No terminal symbols:- These are the combination of terminal symbols which can be further sub divided. – Ex:- <A> or <Noun>
  • 5. • Production :- It is called as re-writing rule • It can be represented as :- – Each production consists of a No terminal followed by an arrow (-) or equal to (=), followed by string of Non terminals and terminals – Ex:- A  b S  Aa
  • 6. Syntax Tree • A Graphical representation of any statement of a Language is called as syntax tree.
  • 8. Derivation • The replacement of Non terminal symbols according to the given production rule is called as derivation • Types of Derivation: – Leftmost derivation – Rightmost derivation
  • 9. Rules for English Language 1) <Sentence>  <NP><VP> 2) <NP>  <article><noun> 3) <VP>  <verb> 4) <VP>  <verb><adverb> 5) <article>  The 6) <noun>  student 7) <verb>  studies 8) <adverb>  hard 9) <adverb>  slowly
  • 10. Derivation • Structure Rules applied • <Sentence> • <NP><VP> (1) • <article><noun>< VP> (2) • <article><noun> <verb><adverb> (4) • The <noun> <verb><adverb> (5) • The student <verb> <adverb> (6) • The student studies <adverb> (7) • The student studies hard (8)
  • 11. • Ex. Consider the full grammar, • E → E+E • E → E*E • E → id • Let us derive the string “ id + id * id”
  • 13. Using Right most derivation:-
  • 14. Rules
  • 16. • Derive the string –babbaaaba
  • 17.
  • 19.
  • 20. Reduction • It is the process of replacement of string or part of string by non terminal according to the production rule.
  • 21. Structure Rules applied • The student studies hard • <article> student studies hard (5) • <article><noun> studies hard (6) • <article><noun> <verb> hard (7) • <article><noun> <verb> <adverb> (8) • <NP> <verb> <adverb> (2) • <NP><VP> (4) • <Sentence> (1)
  • 22. Ambiguity of Grammar • The Grammar for a language is said to be ambiguous if there exists at least one string which can be generated (or, derived) in more than one way • i. e. there can be more than one leftmost derivations, more than one rightmost derivations & also more than one derivation trees associated with such a string.
  • 23. • Ex. Consider the full grammar, • E → E+E • E → E*E • E → id • Let us derive the string “ id + id * id”
  • 24.
  • 25.
  • 26. id id
  • 28. • Complier:- • These are the system programs which will automatically translate the High level language program in to the machine language program Source program Target program / High level Lang. Compiler M/C Lang. Prog. Prog. Database
  • 29. • Cross Compiler:- • These are the system programs which will automatically translate the HLL program compatible with M/C A, in to the machine language program compatible with M/C A , but the underlying M/C is M/C B Source program Target program / HLL Prog. Cross Compiler M/C Lang. Prog. Compatible with M/C A M/C B
  • 30. P Code Compiler Source Program Compiler P-Code interpreter Obj Program Exexute P-Code interpreter
  • 31. • Very similar in concept of Interpreter • In pseudo- code complier program is analyzed and converted into an intermediate form, which is then executed interpretively. • The source program is compiled, the resulted object program is in p-code. This p-code program is then read and executed under control of p-code interpreter.
  • 32. Compilation process overview • Compilation process is vast and complex. • Hence it is divided into a series of subtasks called as phases. • Each of which transform the source program form one representation to another. • The compilation process involves two major tasks.
  • 33. Compilation process overview Analysis of + Synthesis of = Translation source text Target text of prog in obj form
  • 34. • Analysis of source text – Lexical Analysis (Scanner) – Syntax Analysis (Parser) – Semantic analysis. • Synthesis of target text – Storage allocation – Code generation
  • 35. Analysis of source text • Determine validity of source statement from the analysis view point. • Determine the content of source statement. • Construct the suitable representation of the source statement f0r use by the subsequent analysis phase or by the synthesis phase of compiler.
  • 36. Synthesis of target text • Memory allocation:- It is the simple task given to the presence of symbol table. The memory requirement of an identifier is computed from its length, type and dimension and memory is allocated to it. • Code generation:- the code generation uses the knowledge of target architecture , knowledge of instruction and also the addressing modes in the target computer to select the appropriate instruction.
  • 37. Synthesis of target text • The important issues in code generation are – Determine the space where the intermediate results should ne kept i.e. whether they should be kept in memory location or held in machine register. – Determine which instruction should be used for type conversion operation. – Determine which addressing mode should be used.
  • 38. Phase Structure of Compiler
  • 39.
  • 40.
  • 41. Code Optimization • This is an optional phase to improve the intermediate code so that ultimate object program can run faster and also take less phase. • The ultimate aim of this technique is to improve the execution efficiency of a program by – Eliminating redundancies – Rearranging the computation in the program with out affecting target machine.
  • 42. Code optimization techniques 1. Compile time evaluation 2. Elimination of common sub expressions 3. Frequency reduction 4. Strength reduction 5. Dead code elimination 6. Boolean sub expressions optimization 7. Local and Global optimization.