SlideShare a Scribd company logo
SYSTEM PROGRAMMING
TOPIC : Overview of Language Processor : Fundamentals of LP , Symbol
Table , Data Structure for LP
SUBMITTED BY :
Bhavin Darji
SUBMITTED TO :
Prof.
Fundamentals of Language Processor
Language Processing = Analysis of SP + Synthesis of TP
Source program as a analysis phase
Target program in synthesis phase
There are 3 components
◦ Lexical rule
◦ Syntax rule
◦ Semantic rule
Analysis Phase
This specification consists of three components
Lexical rules
Specify the information and formation of valid lexical units in the source language
Syntax Rules
Specify the information and formation of valid statements in the source language
Semantic Rules
Associated with valid statements of language
Consider the following example
A = (B* 100) /D;
Lexical units identifies =, * and / operators, 100 as constant, and the remaining strings
as identifiers.
Syntax analysis identifies the statement as an assignment statement with A as the left
hand side and (B * 100) / D as the expression on the right hand side.
Semantic analysis determines the meaning of the statement to be the assignment of
B X 100 / D to A.
Synthesis Phase
 It performs two main activities:
 Creation of data structures in the target program (memory allocation)
 Generation of target code (code generation)
 Example
MOVER AREG, PROFIT
MULT AREG, 100
DIV AREG, COST_PRICE MOVEM AREG, PERCENT_PROFIT
…
Lexical Analysis
Reads the source code & divide the source code into tokens.
Token is group of characters with meaning.
Lexical analyzer takes a stream of Lexeme as a input and the output is stream of token.
Example
int a , b;
int Ans;
ans = a+b;
Symbol Type Address
1. int keyword
2. a Identifier 2000
Syntax Analysis
Done in order to verify the grammatical mistake of source code.
Takes a stream of tokens as input and generate a syntax tree.
Example : a=b*c
=
a *
b c
Semantic Analysis
It verify the meaning of each and every sentence.
It just verify weather an operator is operating on required number of operand or not.
Example : int a , b, ans ;
ans = a + b;
Intermediate code generation
Source code is converted into a intermediate representation known as three address code.
Example :
◦ A = b*c+d;
◦ T1=b*c;
◦ A=t1+d;
After this four analysis we get our target program.
The Symbol Table
Advance data structure used by compiler to store complete information of source code at any
phase
If new variable encountered that should be store into the symbol table.
Communicate with each and every phase of compiler.
Lexical
Analyzer
Semantic
Analyzer
Code
Generator
Symbol
Table
Syntax
Analyzer
Criteria of Classification of Data Structure
of LP:
Nature of a Data Structure :
◦ Linear or
◦ Non Linear
Purpose of a Data Structure :
◦ Search or
◦ Allocation
Linear Data Structure
Consist of a linear arrangement of elements in the memory.
Advantage : Facilities Efficient Search
Disadvantage :
◦ Require a contagious area of memory
◦ Wastage of Memory
Non Linear Data Structure
Overcomes the disadvantage of Linear DS.
Elements of Non linear DS are accessed using pointers.
Elements need not occupy contiguous area of memory.
Symbol Table Organization
Sequential Search Organization
#1
#2
#f
#n
Occupied Entries
Free Entries
n: Number of entries in the table f: Number of occupied entries
(2)Binary Search Organization
All entries in a table are assumed to satisfy an ordering relation.
‘<‘ relation implies that the symbol occupying an entry is ‘smaller or larger than’ the symbol.
If the new symbol is smaller then it will be put at left side otherwise put at right side.
Every new symbol the existing symbol may have to be shifted to ensure ordering
relation.
Hence , this is not good for the symbol table.
It is suitable for table which has fixed set of symbol.
Ex. Table of reserve word in a programming language.
(3)Hash Table Organization
There are three possibilities when eth entry will be arrived :
- Entry may be occupied by symbol S.
- Entry may be occupied by some other symbol.
- Entry may not occupied.
 Collision: when eth entry will be occupied by some other entry then that is collision.
A simple solution to avoid collision is to enter a distinct entry in symbol table. This technique is
known as direct entry organization.
Allocation Data Structures
1)Stacks
A linear data structure which satisfies following properties:
- Allocation and de-allocation are performed in a LIFO manner.
- Only last element is accessible at any time.
It has a limited size
2)Heaps
Non Linear Data Structure
It is used for dynamic memory
Permits allocation and de-allocation of entities in random order
We are responsible to de-allocate the memory
It has no size restriction
We use pointer to access it , so it is slightly slower.
THANK YOU

More Related Content

What's hot

compiler ppt on symbol table
 compiler ppt on symbol table compiler ppt on symbol table
compiler ppt on symbol tablenadarmispapaulraj
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
sanchi29
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
Tanzeela_Hussain
 
Ch 4 linker loader
Ch 4 linker loaderCh 4 linker loader
Ch 4 linker loader
Malek Sumaiya
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
Huawei Technologies
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
Munni28
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
Dattatray Gandhmal
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
raveena sharma
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
sonalikharade3
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
shindept123
 
Compiler design
Compiler designCompiler design
Compiler design
Thakur Ganeshsingh Thakur
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
Hemant Chetwani
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
Akhil Kaushik
 
Three Address code
Three Address code Three Address code
Three Address code
Pooja Dixit
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
Akhil Kaushik
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
Akshaya Arunan
 
Software tools
Software toolsSoftware tools
Software tools
ravindravekariya
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
Hemant Sharma
 

What's hot (20)

compiler ppt on symbol table
 compiler ppt on symbol table compiler ppt on symbol table
compiler ppt on symbol table
 
Assembler
AssemblerAssembler
Assembler
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Ch 4 linker loader
Ch 4 linker loaderCh 4 linker loader
Ch 4 linker loader
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
 
Compiler design
Compiler designCompiler design
Compiler design
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
Three Address code
Three Address code Three Address code
Three Address code
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
Software tools
Software toolsSoftware tools
Software tools
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 

Similar to Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Structure for LP

Parsing
ParsingParsing
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
appasami
 
Chapter-3 compiler.pptx course materials
Chapter-3 compiler.pptx course materialsChapter-3 compiler.pptx course materials
Chapter-3 compiler.pptx course materials
gadisaAdamu
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
Anujashejwal
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
Sumathi Gnanasekaran
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
Bilalzafar22
 
Chapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptxChapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptx
ArebuMaruf
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
Akhil Kaushik
 
Compiler chapter six .ppt course material
Compiler chapter six .ppt course materialCompiler chapter six .ppt course material
Compiler chapter six .ppt course material
gadisaAdamu
 
compiler design course focus of chapter 3 and 4 part
compiler design course focus of chapter 3 and 4 partcompiler design course focus of chapter 3 and 4 part
compiler design course focus of chapter 3 and 4 part
abel185080
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
Akshaya Arunan
 
Plc part 2
Plc  part 2Plc  part 2
Plc part 2
Taymoor Nazmy
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Avelin Huo
 
Symbol Table.pptx
Symbol Table.pptxSymbol Table.pptx
Symbol Table.pptx
LaibaFaisal3
 
Compiler and symbol table
Compiler and symbol tableCompiler and symbol table
Compiler and symbol table
Sunjid Hasan
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
prakashvs7
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
Archana Gopinath
 
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
Swati Chauhan
 
Basic of compiler
Basic of compiler Basic of compiler
Basic of compiler
Abhishek Singh
 
Lecture 21 22
Lecture 21 22Lecture 21 22
Lecture 21 22
Najmul Hassan
 

Similar to Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Structure for LP (20)

Parsing
ParsingParsing
Parsing
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
 
Chapter-3 compiler.pptx course materials
Chapter-3 compiler.pptx course materialsChapter-3 compiler.pptx course materials
Chapter-3 compiler.pptx course materials
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
 
Chapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptxChapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptx
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Compiler chapter six .ppt course material
Compiler chapter six .ppt course materialCompiler chapter six .ppt course material
Compiler chapter six .ppt course material
 
compiler design course focus of chapter 3 and 4 part
compiler design course focus of chapter 3 and 4 partcompiler design course focus of chapter 3 and 4 part
compiler design course focus of chapter 3 and 4 part
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
 
Plc part 2
Plc  part 2Plc  part 2
Plc part 2
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
 
Symbol Table.pptx
Symbol Table.pptxSymbol Table.pptx
Symbol Table.pptx
 
Compiler and symbol table
Compiler and symbol tableCompiler and symbol table
Compiler and symbol table
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
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
 
Basic of compiler
Basic of compiler Basic of compiler
Basic of compiler
 
Lecture 21 22
Lecture 21 22Lecture 21 22
Lecture 21 22
 

Recently uploaded

Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
ambekarshweta25
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
itech2017
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 

Recently uploaded (20)

Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 

Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Structure for LP

  • 1. SYSTEM PROGRAMMING TOPIC : Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Structure for LP SUBMITTED BY : Bhavin Darji SUBMITTED TO : Prof.
  • 2. Fundamentals of Language Processor Language Processing = Analysis of SP + Synthesis of TP Source program as a analysis phase Target program in synthesis phase There are 3 components ◦ Lexical rule ◦ Syntax rule ◦ Semantic rule
  • 3. Analysis Phase This specification consists of three components Lexical rules Specify the information and formation of valid lexical units in the source language Syntax Rules Specify the information and formation of valid statements in the source language Semantic Rules Associated with valid statements of language
  • 4. Consider the following example A = (B* 100) /D; Lexical units identifies =, * and / operators, 100 as constant, and the remaining strings as identifiers. Syntax analysis identifies the statement as an assignment statement with A as the left hand side and (B * 100) / D as the expression on the right hand side. Semantic analysis determines the meaning of the statement to be the assignment of B X 100 / D to A.
  • 5. Synthesis Phase  It performs two main activities:  Creation of data structures in the target program (memory allocation)  Generation of target code (code generation)  Example MOVER AREG, PROFIT MULT AREG, 100 DIV AREG, COST_PRICE MOVEM AREG, PERCENT_PROFIT …
  • 6. Lexical Analysis Reads the source code & divide the source code into tokens. Token is group of characters with meaning. Lexical analyzer takes a stream of Lexeme as a input and the output is stream of token.
  • 7. Example int a , b; int Ans; ans = a+b; Symbol Type Address 1. int keyword 2. a Identifier 2000
  • 8. Syntax Analysis Done in order to verify the grammatical mistake of source code. Takes a stream of tokens as input and generate a syntax tree. Example : a=b*c = a * b c
  • 9. Semantic Analysis It verify the meaning of each and every sentence. It just verify weather an operator is operating on required number of operand or not. Example : int a , b, ans ; ans = a + b;
  • 10. Intermediate code generation Source code is converted into a intermediate representation known as three address code. Example : ◦ A = b*c+d; ◦ T1=b*c; ◦ A=t1+d; After this four analysis we get our target program.
  • 11. The Symbol Table Advance data structure used by compiler to store complete information of source code at any phase If new variable encountered that should be store into the symbol table. Communicate with each and every phase of compiler. Lexical Analyzer Semantic Analyzer Code Generator Symbol Table Syntax Analyzer
  • 12. Criteria of Classification of Data Structure of LP: Nature of a Data Structure : ◦ Linear or ◦ Non Linear Purpose of a Data Structure : ◦ Search or ◦ Allocation
  • 13. Linear Data Structure Consist of a linear arrangement of elements in the memory. Advantage : Facilities Efficient Search Disadvantage : ◦ Require a contagious area of memory ◦ Wastage of Memory
  • 14. Non Linear Data Structure Overcomes the disadvantage of Linear DS. Elements of Non linear DS are accessed using pointers. Elements need not occupy contiguous area of memory.
  • 16. Sequential Search Organization #1 #2 #f #n Occupied Entries Free Entries n: Number of entries in the table f: Number of occupied entries
  • 17. (2)Binary Search Organization All entries in a table are assumed to satisfy an ordering relation. ‘<‘ relation implies that the symbol occupying an entry is ‘smaller or larger than’ the symbol. If the new symbol is smaller then it will be put at left side otherwise put at right side. Every new symbol the existing symbol may have to be shifted to ensure ordering relation. Hence , this is not good for the symbol table. It is suitable for table which has fixed set of symbol. Ex. Table of reserve word in a programming language.
  • 18. (3)Hash Table Organization There are three possibilities when eth entry will be arrived : - Entry may be occupied by symbol S. - Entry may be occupied by some other symbol. - Entry may not occupied.  Collision: when eth entry will be occupied by some other entry then that is collision. A simple solution to avoid collision is to enter a distinct entry in symbol table. This technique is known as direct entry organization.
  • 19. Allocation Data Structures 1)Stacks A linear data structure which satisfies following properties: - Allocation and de-allocation are performed in a LIFO manner. - Only last element is accessible at any time. It has a limited size
  • 20. 2)Heaps Non Linear Data Structure It is used for dynamic memory Permits allocation and de-allocation of entities in random order We are responsible to de-allocate the memory It has no size restriction We use pointer to access it , so it is slightly slower.