SlideShare a Scribd company logo
2
Most read
8
Most read
9
Most read
Presentation by
Rushikesh kadam
SYSTEM
SOFTWARE
Lexical analyzer
Input string from
source code
Tokens,
lexims
int main( )
{
}
i n t m a i n ( ) { }
i n t m a i n ( ) { }
• Lexim begin pointer
• points to the beginning of every token
• Forward pointer
• Points every next character in the input string
Begin pointer
Forward
pointer
intially
i n t m a i n ( ) { }
Begin pointer
Forward
pointer
i n t m a i n ( ) { }
Begin pointer
Forward
pointer
i n t m a i n ( ) { }
Begin pointer
Forward
pointer
End of lexime
i n t m a i n ( ) { }
Begin pointer
Forward
pointer
i n t m a i n ( ) { }
Reading each
character
One system call
1000 character s 1000 system call
Buffering
• One Buffer Scheme
int i,j ;
A block of data is first read into a buffer, and then
second by lexical analyzer.
i n t i , j ;
In this scheme, only one buffer is used to store the input
string but the problem with this scheme is that if lexeme is
very long then it crosses the buffer boundary, to scan rest of
the lexeme the buffer has to be refilled, that makes
overwriting the first of lexeme.
• Two Buffer Scheme
int i,j ;
i=i+1;
i n t i , j ;
BP
FP
eof
Second buffer
i n t i , j ;
BP
FP
eof
First buffer
eof = end of file buffer
sentinal
• Algorithm
switch(*forward++)
{
}
case ‘ eof’:
if (forward is at the end of 1st buffer)
{
forward= beginning of 2nd buffer;
refill 2nd buffer;
}
else if (forward is at the end of 2nd buffer)
{
forward= beginning of 1st buffer;
refill 1st buffer;
}
else break;
case for other charcters :
THANK YOU!

More Related Content

PPTX
The role of the parser and Error recovery strategies ppt in compiler design
PPTX
Algorithm and pseudocode conventions
PDF
Issues in the design of Code Generator
PDF
Code optimization in compiler design
PPTX
Operating system critical section
PPTX
System software - macro expansion,nested macro calls
PPT
Lecture 1 - Lexical Analysis.ppt
PPTX
Fundamentals of Language Processing
The role of the parser and Error recovery strategies ppt in compiler design
Algorithm and pseudocode conventions
Issues in the design of Code Generator
Code optimization in compiler design
Operating system critical section
System software - macro expansion,nested macro calls
Lecture 1 - Lexical Analysis.ppt
Fundamentals of Language Processing

What's hot (20)

PPTX
System Programming Unit II
PPTX
Lexical analyzer generator lex
PPTX
Introduction to loaders
PPT
Chapter 6 intermediate code generation
PPTX
Design of a two pass assembler
PPTX
First pass of assembler
PPT
Intermediate code generation (Compiler Design)
PPTX
COMPILER DESIGN OPTIONS
PDF
Syntax analysis
PPTX
Phases of compiler
PPTX
Non- Deterministic Algorithms
PPT
Introduction to Compiler design
PPTX
Assemblers
PDF
Run time storage
PPTX
Introduction TO Finite Automata
PPTX
A simple approach of lexical analyzers
PPTX
Specification-of-tokens
PPTX
sum of subset problem using Backtracking
PPT
Type Checking(Compiler Design) #ShareThisIfYouLike
PPTX
Direct linking loaders
System Programming Unit II
Lexical analyzer generator lex
Introduction to loaders
Chapter 6 intermediate code generation
Design of a two pass assembler
First pass of assembler
Intermediate code generation (Compiler Design)
COMPILER DESIGN OPTIONS
Syntax analysis
Phases of compiler
Non- Deterministic Algorithms
Introduction to Compiler design
Assemblers
Run time storage
Introduction TO Finite Automata
A simple approach of lexical analyzers
Specification-of-tokens
sum of subset problem using Backtracking
Type Checking(Compiler Design) #ShareThisIfYouLike
Direct linking loaders
Ad

Similar to Input buffering (20)

PPTX
Lexical Analysis - Compiler Design
PPTX
LexicalAnalysis chapter2 i n compiler design.pptx
PPTX
Ch03-LexicalAnalysis chapter2 in compiler design.pptx
PPT
1.Role lexical Analyzer
PDF
role of lexical parser compiler design1-181124035217.pdf
PDF
Ch03-LexicalAnalysis in compiler design subject.pdf
PDF
10600122065_Animesh mani (CD).pdf
PPT
Data design and analysis of computing tools
PDF
Lexical analysis - Compiler Design
PPT
Compiler Design ug semLexical Analysis.ppt
PPTX
A Role of Lexical Analyzer
PDF
Lexical Analysis - Compiler design
PPTX
5490ce2bf23093de242ccc160dbfd3b639d.pptx
DOCX
Compiler Design
PPT
52232.-Compiler-Design-Lexical-Analysis.ppt
PPTX
3. Lexical analysis
PPT
atc 3rd module compiler and automata.ppt
PPT
SS & CD Module 3
PPT
Module 2
PDF
Modify the Simple lexer program given in the link below to .pdf
Lexical Analysis - Compiler Design
LexicalAnalysis chapter2 i n compiler design.pptx
Ch03-LexicalAnalysis chapter2 in compiler design.pptx
1.Role lexical Analyzer
role of lexical parser compiler design1-181124035217.pdf
Ch03-LexicalAnalysis in compiler design subject.pdf
10600122065_Animesh mani (CD).pdf
Data design and analysis of computing tools
Lexical analysis - Compiler Design
Compiler Design ug semLexical Analysis.ppt
A Role of Lexical Analyzer
Lexical Analysis - Compiler design
5490ce2bf23093de242ccc160dbfd3b639d.pptx
Compiler Design
52232.-Compiler-Design-Lexical-Analysis.ppt
3. Lexical analysis
atc 3rd module compiler and automata.ppt
SS & CD Module 3
Module 2
Modify the Simple lexer program given in the link below to .pdf
Ad

Recently uploaded (20)

PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PPTX
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
PDF
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
PDF
Navigating the Thai Supplements Landscape.pdf
PPTX
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
PPTX
Business_Capability_Map_Collection__pptx
PPT
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
PDF
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPTX
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
PPTX
SAP 2 completion done . PRESENTATION.pptx
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PPTX
Leprosy and NLEP programme community medicine
PPTX
CYBER SECURITY the Next Warefare Tactics
PPTX
Introduction to Inferential Statistics.pptx
PDF
Microsoft 365 products and services descrption
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PPTX
A Complete Guide to Streamlining Business Processes
PDF
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
STERILIZATION AND DISINFECTION-1.ppthhhbx
FMIS 108 and AISlaudon_mis17_ppt_ch11.pptx
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
Navigating the Thai Supplements Landscape.pdf
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
Business_Capability_Map_Collection__pptx
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
SAP 2 completion done . PRESENTATION.pptx
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
Leprosy and NLEP programme community medicine
CYBER SECURITY the Next Warefare Tactics
Introduction to Inferential Statistics.pptx
Microsoft 365 products and services descrption
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
A Complete Guide to Streamlining Business Processes
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...

Input buffering

  • 2. Lexical analyzer Input string from source code Tokens, lexims int main( ) { } i n t m a i n ( ) { }
  • 3. i n t m a i n ( ) { } • Lexim begin pointer • points to the beginning of every token • Forward pointer • Points every next character in the input string Begin pointer Forward pointer intially
  • 4. i n t m a i n ( ) { } Begin pointer Forward pointer i n t m a i n ( ) { } Begin pointer Forward pointer
  • 5. i n t m a i n ( ) { } Begin pointer Forward pointer End of lexime
  • 6. i n t m a i n ( ) { } Begin pointer Forward pointer
  • 7. i n t m a i n ( ) { } Reading each character One system call 1000 character s 1000 system call
  • 8. Buffering • One Buffer Scheme int i,j ; A block of data is first read into a buffer, and then second by lexical analyzer. i n t i , j ; In this scheme, only one buffer is used to store the input string but the problem with this scheme is that if lexeme is very long then it crosses the buffer boundary, to scan rest of the lexeme the buffer has to be refilled, that makes overwriting the first of lexeme.
  • 9. • Two Buffer Scheme int i,j ; i=i+1; i n t i , j ; BP FP eof Second buffer i n t i , j ; BP FP eof First buffer eof = end of file buffer sentinal
  • 10. • Algorithm switch(*forward++) { } case ‘ eof’: if (forward is at the end of 1st buffer) { forward= beginning of 2nd buffer; refill 2nd buffer; } else if (forward is at the end of 2nd buffer) { forward= beginning of 1st buffer; refill 1st buffer; } else break; case for other charcters :