SlideShare une entreprise Scribd logo
INPUT BUFFERING
• Speed of lexical analysis is a concern.
• Lexical analysis needs to look ahead several
characters before a match can be announced.
• We have two buffer input scheme that is
useful when look ahead is necessary
– Buffer Pairs
– Sentinels
Buffer Pairs
• Buffer is divided into two N-characters halves.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
N
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
N N
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
N N
Figure: An input buffer in two halves.
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
N N
Figure: An input buffer in two halves.
1st half
Buffer Pairs
• Buffer is divided into two N-characters halves.
• N is number of characters eg: 1024 or 4096.
N N
Figure: An input buffer in two halves.
1st half 2nd half
Lexeme_begining
Lexeme_begining
forward
Lexeme_begining
forward
Lexeme_begining
forward
Lexeme_begining
forward
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
if forward at end of first half then begin
reload second half;
forward := forward +1
end
else if forward at end of second half then begin
reload first half;
move forward to beginning of first half
end
else forward := forward + 1;
For Eg: consider
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
abc
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
abc  Identifier
: a : b : c : = : p :
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
=
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
=  operator
: a : b : c : = : p :
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
For Eg: consider
abc = pqr * xyz;
Reload 2nd half
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
Reload 2nd half
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
pqr
: a : b : c : = : p : q : r : * : x : y : z : eof :
Lexeme_begining
forward
For Eg: consider
abc = pqr * xyz;
pqr  identifier
Sentinels
Sentinels
Sentinels
Lexeme_begining
Sentinels
Lexeme_begining
forward
Sentinels
Lexeme_begining
forward
|eof
Sentinels
Lexeme_begining
forward
|eof |eof
• For Example: Consider
E = M * C * * 2
: : : E : : = : M : * : eof : eof
• For Example: Consider
E = M * C * * 2
: : : E : : = : M : * : eof : eof
• For Example: Consider
E = M * C * * 2
: : : E : : = : M : * : eof : eof
Lexeme_begining
• For Example: Consider
E = M * C * * 2
: : : E : : = : M : * : eof : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
Lexeme_begining
: : : E : : = : M : * : eof : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
Lexeme_begining
: : : E : : = : M : * : eof : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
Lexeme_begining
: : : E : : = : M : * : eof : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
: : : E : : = : M : * : eof : eof
Lexeme_begining
: : : E : : = : M : * : eof : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof eof
: : : E : : = : M : * : eof eof
: : : E : : = : M : * : eof eof
Lexeme_begining
: : : E : : = : M : * : eof eof
Lexeme_begining
forward
: : : E : : = : M : * : eof eof
: : : E : : = : M : * : eof eof
: : : E : : = : M : * : eof eof
Lexeme_begining
: : : E : : = : M : * : eof eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
: : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
Lexeme_begining
forward
forward : = forward + 1;
if forward = eof then begin
if forward at end of first half then begin
reload second half;
forward := forward + 1
end
else if forward at end of second half then begin
reload first half
move forward to beginning of first half
end
else /* eof within a buffer signifying end of input */
terminate lexical analysis
end
forward : = forward + 1;
if forward = eof then begin
if forward at end of first half then begin
reload second half;
forward := forward + 1
end
else if forward at end of second half then begin
reload first half
move forward to beginning of first half
end
else /* eof within a buffer signifying end of input */
terminate lexical analysis
end

Contenu connexe

Tendances

Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazationSiva Sathya
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignmentKarthi Keyan
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysisDattatray Gandhmal
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environmentIffat Anjum
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assemblerBansari Shah
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
Three Address code
Three Address code Three Address code
Three Address code Pooja Dixit
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler DesignAkhil Kaushik
 

Tendances (20)

Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
Back patching
Back patchingBack patching
Back patching
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
1.Role lexical Analyzer
1.Role lexical Analyzer1.Role lexical Analyzer
1.Role lexical Analyzer
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
 
Lecture 14 run time environment
Lecture 14 run time environmentLecture 14 run time environment
Lecture 14 run time environment
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Three Address code
Three Address code Three Address code
Three Address code
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 

Dernier

Pour une traite de qualité, mieux comprendre l’interface trayon-manchon
Pour une traite de qualité, mieux comprendre l’interface trayon-manchonPour une traite de qualité, mieux comprendre l’interface trayon-manchon
Pour une traite de qualité, mieux comprendre l’interface trayon-manchonInstitut de l'Elevage - Idele
 
2024 03 27 JTC actualités C Perrot (idele).pdf
2024 03 27 JTC actualités C Perrot (idele).pdf2024 03 27 JTC actualités C Perrot (idele).pdf
2024 03 27 JTC actualités C Perrot (idele).pdfidelewebmestre
 
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?[2024] Comment scaler une application PHP vieille de plus de 20 ans ?
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?LAHAXE Arnaud
 
Présentation_Soirée-Information_ St-Eugène.pptx
Présentation_Soirée-Information_ St-Eugène.pptxPrésentation_Soirée-Information_ St-Eugène.pptx
Présentation_Soirée-Information_ St-Eugène.pptxVille de Châteauguay
 
Provinlait 2024-Leviers fourrages - Madrid Aurélie Frayssinhes, Sandra (Cha...
Provinlait 2024-Leviers fourrages - Madrid  Aurélie  Frayssinhes, Sandra (Cha...Provinlait 2024-Leviers fourrages - Madrid  Aurélie  Frayssinhes, Sandra (Cha...
Provinlait 2024-Leviers fourrages - Madrid Aurélie Frayssinhes, Sandra (Cha...idelewebmestre
 
JTC_2024_TC Bâtiment et bien-être estival.pdf
JTC_2024_TC Bâtiment et bien-être estival.pdfJTC_2024_TC Bâtiment et bien-être estival.pdf
JTC_2024_TC Bâtiment et bien-être estival.pdfidelewebmestre
 

Dernier (7)

Pour une traite de qualité, mieux comprendre l’interface trayon-manchon
Pour une traite de qualité, mieux comprendre l’interface trayon-manchonPour une traite de qualité, mieux comprendre l’interface trayon-manchon
Pour une traite de qualité, mieux comprendre l’interface trayon-manchon
 
JTC 2024 - Actualités sur le bien-être animal
JTC 2024 - Actualités sur le bien-être animalJTC 2024 - Actualités sur le bien-être animal
JTC 2024 - Actualités sur le bien-être animal
 
2024 03 27 JTC actualités C Perrot (idele).pdf
2024 03 27 JTC actualités C Perrot (idele).pdf2024 03 27 JTC actualités C Perrot (idele).pdf
2024 03 27 JTC actualités C Perrot (idele).pdf
 
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?[2024] Comment scaler une application PHP vieille de plus de 20 ans ?
[2024] Comment scaler une application PHP vieille de plus de 20 ans ?
 
Présentation_Soirée-Information_ St-Eugène.pptx
Présentation_Soirée-Information_ St-Eugène.pptxPrésentation_Soirée-Information_ St-Eugène.pptx
Présentation_Soirée-Information_ St-Eugène.pptx
 
Provinlait 2024-Leviers fourrages - Madrid Aurélie Frayssinhes, Sandra (Cha...
Provinlait 2024-Leviers fourrages - Madrid  Aurélie  Frayssinhes, Sandra (Cha...Provinlait 2024-Leviers fourrages - Madrid  Aurélie  Frayssinhes, Sandra (Cha...
Provinlait 2024-Leviers fourrages - Madrid Aurélie Frayssinhes, Sandra (Cha...
 
JTC_2024_TC Bâtiment et bien-être estival.pdf
JTC_2024_TC Bâtiment et bien-être estival.pdfJTC_2024_TC Bâtiment et bien-être estival.pdf
JTC_2024_TC Bâtiment et bien-être estival.pdf
 

Input-Buffering

  • 1. INPUT BUFFERING • Speed of lexical analysis is a concern. • Lexical analysis needs to look ahead several characters before a match can be announced. • We have two buffer input scheme that is useful when look ahead is necessary – Buffer Pairs – Sentinels
  • 2. Buffer Pairs • Buffer is divided into two N-characters halves.
  • 3. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096.
  • 4. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096.
  • 5. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096.
  • 6. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096.
  • 7. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096. N
  • 8. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096. N N
  • 9. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096. N N Figure: An input buffer in two halves.
  • 10. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096. N N Figure: An input buffer in two halves. 1st half
  • 11. Buffer Pairs • Buffer is divided into two N-characters halves. • N is number of characters eg: 1024 or 4096. N N Figure: An input buffer in two halves. 1st half 2nd half
  • 12.
  • 13.
  • 19. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 20. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 21. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 22. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 23. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 24. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 25. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 26. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 27. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 28. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 29. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 30. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 31. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 32. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 33. if forward at end of first half then begin reload second half; forward := forward +1 end else if forward at end of second half then begin reload first half; move forward to beginning of first half end else forward := forward + 1;
  • 35. For Eg: consider abc = pqr * xyz;
  • 36. : a : b : c : = : p : For Eg: consider abc = pqr * xyz;
  • 37. : a : b : c : = : p : For Eg: consider abc = pqr * xyz;
  • 38. : a : b : c : = : p : Lexeme_begining For Eg: consider abc = pqr * xyz;
  • 39. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 40. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 41. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 42. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 43. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz; abc
  • 44. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz; abc  Identifier
  • 45. : a : b : c : = : p : For Eg: consider abc = pqr * xyz;
  • 46. : a : b : c : = : p : Lexeme_begining For Eg: consider abc = pqr * xyz;
  • 47. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 48. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 49. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz; =
  • 50. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz; =  operator
  • 51. : a : b : c : = : p : For Eg: consider abc = pqr * xyz;
  • 52. : a : b : c : = : p : Lexeme_begining For Eg: consider abc = pqr * xyz;
  • 53. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 54. : a : b : c : = : p : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 55. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining For Eg: consider abc = pqr * xyz;
  • 56. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining For Eg: consider abc = pqr * xyz; Reload 2nd half
  • 57. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining forward For Eg: consider abc = pqr * xyz; Reload 2nd half
  • 58. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 59. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining forward For Eg: consider abc = pqr * xyz;
  • 60. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining forward For Eg: consider abc = pqr * xyz; pqr
  • 61. : a : b : c : = : p : q : r : * : x : y : z : eof : Lexeme_begining forward For Eg: consider abc = pqr * xyz; pqr  identifier
  • 68. • For Example: Consider E = M * C * * 2 : : : E : : = : M : * : eof : eof
  • 69. • For Example: Consider E = M * C * * 2 : : : E : : = : M : * : eof : eof
  • 70. • For Example: Consider E = M * C * * 2 : : : E : : = : M : * : eof : eof Lexeme_begining
  • 71. • For Example: Consider E = M * C * * 2 : : : E : : = : M : * : eof : eof Lexeme_begining forward
  • 72. : : : E : : = : M : * : eof : eof
  • 73. : : : E : : = : M : * : eof : eof
  • 74. : : : E : : = : M : * : eof : eof Lexeme_begining
  • 75. : : : E : : = : M : * : eof : eof Lexeme_begining forward
  • 76. : : : E : : = : M : * : eof : eof
  • 77. : : : E : : = : M : * : eof : eof
  • 78. : : : E : : = : M : * : eof : eof Lexeme_begining
  • 79. : : : E : : = : M : * : eof : eof Lexeme_begining forward
  • 80. : : : E : : = : M : * : eof : eof
  • 81. : : : E : : = : M : * : eof : eof
  • 82. : : : E : : = : M : * : eof : eof Lexeme_begining
  • 83. : : : E : : = : M : * : eof : eof Lexeme_begining forward
  • 84. : : : E : : = : M : * : eof : eof
  • 85. : : : E : : = : M : * : eof : eof
  • 86. : : : E : : = : M : * : eof : eof Lexeme_begining
  • 87. : : : E : : = : M : * : eof : eof Lexeme_begining forward
  • 88. : : : E : : = : M : * : eof eof
  • 89. : : : E : : = : M : * : eof eof
  • 90. : : : E : : = : M : * : eof eof Lexeme_begining
  • 91. : : : E : : = : M : * : eof eof Lexeme_begining forward
  • 92. : : : E : : = : M : * : eof eof
  • 93. : : : E : : = : M : * : eof eof
  • 94. : : : E : : = : M : * : eof eof Lexeme_begining
  • 95. : : : E : : = : M : * : eof eof Lexeme_begining forward
  • 96. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 97. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 98. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 99. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 100. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 101. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 102. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 103. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 104. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 105. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 106. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 107. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 108. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 109. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 110. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 111. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 112. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 113. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 114. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 115. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 116. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 117. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 118. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 119. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 120. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 121. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof
  • 122. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining
  • 123. : : : E : : = : M : * : eof C : * : * : 2 : eof: : : : : eof Lexeme_begining forward
  • 124. forward : = forward + 1; if forward = eof then begin if forward at end of first half then begin reload second half; forward := forward + 1 end else if forward at end of second half then begin reload first half move forward to beginning of first half end else /* eof within a buffer signifying end of input */ terminate lexical analysis end
  • 125. forward : = forward + 1; if forward = eof then begin if forward at end of first half then begin reload second half; forward := forward + 1 end else if forward at end of second half then begin reload first half move forward to beginning of first half end else /* eof within a buffer signifying end of input */ terminate lexical analysis end