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

PPTX
Loop optimization
PPT
Lecture 1 - Lexical Analysis.ppt
PPTX
Type checking in compiler design
PPTX
Macro Processor
PPTX
MACRO PROCESSOR
PPTX
Lexical analyzer generator lex
PPTX
Design of a two pass assembler
PPTX
Loaders ( system programming )
Loop optimization
Lecture 1 - Lexical Analysis.ppt
Type checking in compiler design
Macro Processor
MACRO PROCESSOR
Lexical analyzer generator lex
Design of a two pass assembler
Loaders ( system programming )

What's hot (20)

PPTX
Lexical Analysis - Compiler Design
PPTX
Compiler Design
PPT
Symbol table management and error handling in compiler design
PPT
Compiler Design Basics
PDF
Lecture 01 introduction to compiler
PDF
Language processors
PPTX
Regular Expression to Finite Automata
PPTX
Type checking compiler construction Chapter #6
PPTX
3.5 equivalence of pushdown automata and cfl
PPTX
Toy compiler
PPTX
First pass of assembler
PPTX
Compiler Design Unit 4
PPTX
Symbol Table
PPTX
Syntax Analysis in Compiler Design
PDF
Syntactic analysis in NLP
PPTX
Linker and Loader
PDF
Syntax analysis
PPT
Lexical Analysis
PPTX
Parsing in Compiler Design
PPTX
closure properties of regular language.pptx
Lexical Analysis - Compiler Design
Compiler Design
Symbol table management and error handling in compiler design
Compiler Design Basics
Lecture 01 introduction to compiler
Language processors
Regular Expression to Finite Automata
Type checking compiler construction Chapter #6
3.5 equivalence of pushdown automata and cfl
Toy compiler
First pass of assembler
Compiler Design Unit 4
Symbol Table
Syntax Analysis in Compiler Design
Syntactic analysis in NLP
Linker and Loader
Syntax analysis
Lexical Analysis
Parsing in Compiler Design
closure properties of regular language.pptx
Ad

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

PPTX
Compiler and symbol table
PPTX
System Programming Overview
PDF
Handout#08
PPTX
Unit 3 Compiler Design Regulation 2021.pptx
PPT
Symbol Table, Error Handler & Code Generation
PPTX
Symbol Table.pptx
PDF
Symbol table in compiler Design
PDF
C compiler(final)
PPTX
compiler design symbol table concept.pptx
PDF
Principles of Compiler Design
PDF
Assembler
PPTX
Plc part 2
PPTX
What is symbol table?
PPTX
Data structures - Introduction
PPT
00. Basics of Data Structures.ppt
PPTX
Dsa unit 1
PPTX
The Phases of a Compiler
PPTX
System software module 4 presentation file
PPTX
Lecture 01 Intro to DSA
PPTX
Compiler Design Unit1 PPT Phases of Compiler.pptx
Compiler and symbol table
System Programming Overview
Handout#08
Unit 3 Compiler Design Regulation 2021.pptx
Symbol Table, Error Handler & Code Generation
Symbol Table.pptx
Symbol table in compiler Design
C compiler(final)
compiler design symbol table concept.pptx
Principles of Compiler Design
Assembler
Plc part 2
What is symbol table?
Data structures - Introduction
00. Basics of Data Structures.ppt
Dsa unit 1
The Phases of a Compiler
System software module 4 presentation file
Lecture 01 Intro to DSA
Compiler Design Unit1 PPT Phases of Compiler.pptx
Ad

Recently uploaded (20)

PDF
composite construction of structures.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Construction Project Organization Group 2.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT
Project quality management in manufacturing
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
composite construction of structures.pdf
OOP with Java - Java Introduction (Basics)
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Sustainable Sites - Green Building Construction
Lecture Notes Electrical Wiring System Components
Internet of Things (IOT) - A guide to understanding
Construction Project Organization Group 2.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Structs to JSON How Go Powers REST APIs.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Lesson 3_Tessellation.pptx finite Mathematics
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Project quality management in manufacturing
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.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.