SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Fundamentals of Language Processing
 Language Processing = Analysis of SP + Synthesis of TP
 Collection of Language Processing components engaged in
analysis a source program as the analysis phase and
components engaged in synthesizing a target program
constitute the synthesis phase.
Analysis Phase
 The specification consists of three components:
1. Lexical rules which govern the formation of valid
lexical units in the source language.
2. Syntax rules which govern the formation of valid
statements in the source language.
3. Semantic rules which associate meaning with valid
statements of the language.
Analysis Phase
 Consider the following example:
percent_profit = (profit * 100) / cost_price
 Lexical units identifies =, * and / operators, 100 as constant, and
the remaining strings as identifiers.
 Syntax analysis identifies the statement as an assignment
statement with percent_profit as the left hand side and (profit *
100) / cost_price as the expression on the right hand side.
 Semantic analysis determines the meaning of the statement to
be the assignment of profit * 100 / cost_price to percent_profit.
Synthesis Phase
 The synthesis phase is concerned with the construction of
target language statements which have the same meaning as
a source statement.
 It performs two main activities:
1. Creation of data structures in the target program
(memory allocation)
2. Generation of target code (code generation)
Phases & Passes of LP
Language Processor
 Analysis of source statements can not be immediately followed by
synthesis of equivalent target statements due to following reasons:
1. Forward References
2. Issues concerning memory requirements and organization of a LP
Analysis
Phase
Synthesis
Phase
Source
Program
Target
Program
ErrorsErrors
Forward Reference
 It is a reference to the entity which precedes its
definition in the program. Using a variable before a value is
assigned to it is called a forward reference.
 Forward referenced variables have the scope of the
location where they are first referenced. They cannot be
read before a value has been assigned to them, but they
can be used for further forward reference.
Language Processor Pass
 Pass I : performs analysis of Sorce Program and notes
relevant information.
 Pass II : performs synthesis of target program.
Pass I analysis Source Program and generates IR which is
given as input to Pass II to generate target code.
Intermediate Representation (IR)
 An IR reflects the effect of some but not all, analysis
and synthesis tasks performed during language
processing.
Front End Back End
Intermediate
Representation
(IR)
Source
Program
Target
Program
Intermediate Representation (IR)
Properties :-
1. Ease of use.
2. Processing efficiency.
3. Memory efficiency.
Fundamentals of Language Processing

Weitere ähnliche Inhalte

Was ist angesagt?

System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
Manoj Patil
 

Was ist angesagt? (20)

Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Toy compiler
Toy compilerToy compiler
Toy compiler
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
 
Two pass Assembler
Two pass AssemblerTwo pass Assembler
Two pass Assembler
 
Loaders ( system programming )
Loaders ( system programming ) Loaders ( system programming )
Loaders ( system programming )
 
Role-of-lexical-analysis
Role-of-lexical-analysisRole-of-lexical-analysis
Role-of-lexical-analysis
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
First pass of assembler
First pass of assemblerFirst pass of assembler
First pass of assembler
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
Symbol table management and error handling in compiler design
Symbol table management and error handling in compiler designSymbol table management and error handling in compiler design
Symbol table management and error handling in compiler design
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lex
 

Ähnlich wie Fundamentals of Language Processing

Chap 1-dhamdhere system programming
Chap 1-dhamdhere system programmingChap 1-dhamdhere system programming
Chap 1-dhamdhere system programming
TanzoGamerz
 
Chapter One
Chapter OneChapter One
Chapter One
bolovv
 
match the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdfmatch the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdf
arpitaeron555
 

Ähnlich wie Fundamentals of Language Processing (20)

Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
 
Assignment1
Assignment1Assignment1
Assignment1
 
3.2
3.23.2
3.2
 
Chap 1-dhamdhere system programming
Chap 1-dhamdhere system programmingChap 1-dhamdhere system programming
Chap 1-dhamdhere system programming
 
design intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdfdesign intoduction of_COMPILER_DESIGN.pdf
design intoduction of_COMPILER_DESIGN.pdf
 
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATORPSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
 
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
 
Basic of compiler
Basic of compiler Basic of compiler
Basic of compiler
 
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
 
3ss
3ss3ss
3ss
 
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGESOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
 
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGESOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
SOFTWARE TOOL FOR TRANSLATING PSEUDOCODE TO A PROGRAMMING LANGUAGE
 
Compiler Design Material
Compiler Design MaterialCompiler Design Material
Compiler Design Material
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Software tools
Software toolsSoftware tools
Software tools
 
Handout#08
Handout#08Handout#08
Handout#08
 
Assignment11
Assignment11Assignment11
Assignment11
 
SPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptxSPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptx
 
Chapter One
Chapter OneChapter One
Chapter One
 
match the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdfmatch the following attributes to the parts of a compilerstrips ou.pdf
match the following attributes to the parts of a compilerstrips ou.pdf
 

Mehr von Hemant Sharma (6)

Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing Thesis
 
Web Mining & Text Mining
Web Mining & Text MiningWeb Mining & Text Mining
Web Mining & Text Mining
 
Double DES & Triple DES
Double DES & Triple DESDouble DES & Triple DES
Double DES & Triple DES
 
Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Fundamentals of Language Processing

  • 1.
  • 2. Fundamentals of Language Processing  Language Processing = Analysis of SP + Synthesis of TP  Collection of Language Processing components engaged in analysis a source program as the analysis phase and components engaged in synthesizing a target program constitute the synthesis phase.
  • 3. Analysis Phase  The specification consists of three components: 1. Lexical rules which govern the formation of valid lexical units in the source language. 2. Syntax rules which govern the formation of valid statements in the source language. 3. Semantic rules which associate meaning with valid statements of the language.
  • 4. Analysis Phase  Consider the following example: percent_profit = (profit * 100) / cost_price  Lexical units identifies =, * and / operators, 100 as constant, and the remaining strings as identifiers.  Syntax analysis identifies the statement as an assignment statement with percent_profit as the left hand side and (profit * 100) / cost_price as the expression on the right hand side.  Semantic analysis determines the meaning of the statement to be the assignment of profit * 100 / cost_price to percent_profit.
  • 5. Synthesis Phase  The synthesis phase is concerned with the construction of target language statements which have the same meaning as a source statement.  It performs two main activities: 1. Creation of data structures in the target program (memory allocation) 2. Generation of target code (code generation)
  • 6. Phases & Passes of LP Language Processor  Analysis of source statements can not be immediately followed by synthesis of equivalent target statements due to following reasons: 1. Forward References 2. Issues concerning memory requirements and organization of a LP Analysis Phase Synthesis Phase Source Program Target Program ErrorsErrors
  • 7. Forward Reference  It is a reference to the entity which precedes its definition in the program. Using a variable before a value is assigned to it is called a forward reference.  Forward referenced variables have the scope of the location where they are first referenced. They cannot be read before a value has been assigned to them, but they can be used for further forward reference.
  • 8. Language Processor Pass  Pass I : performs analysis of Sorce Program and notes relevant information.  Pass II : performs synthesis of target program. Pass I analysis Source Program and generates IR which is given as input to Pass II to generate target code.
  • 9. Intermediate Representation (IR)  An IR reflects the effect of some but not all, analysis and synthesis tasks performed during language processing. Front End Back End Intermediate Representation (IR) Source Program Target Program
  • 10. Intermediate Representation (IR) Properties :- 1. Ease of use. 2. Processing efficiency. 3. Memory efficiency.