SlideShare une entreprise Scribd logo
1  sur  125
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

Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTanzeela_Hussain
 
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
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignAkhil Kaushik
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in CompilersMahbubur Rahman
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignKuppusamy P
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingR Islam
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGJothi Lakshmi
 

Tendances (20)

Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Role-of-lexical-analysis
Role-of-lexical-analysisRole-of-lexical-analysis
Role-of-lexical-analysis
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Predictive parser
Predictive parserPredictive parser
Predictive parser
 
COMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed TranslationCOMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed Translation
 
Parsing
ParsingParsing
Parsing
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in Compilers
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 

Dernier

JTC 2024 - Réglementation européenne BEA et Transport.pdf
JTC 2024 - Réglementation européenne BEA et Transport.pdfJTC 2024 - Réglementation européenne BEA et Transport.pdf
JTC 2024 - Réglementation européenne BEA et Transport.pdfInstitut de l'Elevage - Idele
 
Câblage, installation et paramétrage d’un réseau informatique.pdf
Câblage, installation et paramétrage d’un réseau informatique.pdfCâblage, installation et paramétrage d’un réseau informatique.pdf
Câblage, installation et paramétrage d’un réseau informatique.pdfmia884611
 
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdf
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdfJTC 2024 - SMARTER Retour sur les indicateurs de santé .pdf
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdfInstitut de l'Elevage - Idele
 
JTC 2024 La relance de la filière de la viande de chevreau.pdf
JTC 2024 La relance de la filière de la viande de chevreau.pdfJTC 2024 La relance de la filière de la viande de chevreau.pdf
JTC 2024 La relance de la filière de la viande de chevreau.pdfInstitut de l'Elevage - Idele
 
Algo II : les piles ( cours + exercices)
Algo II :  les piles ( cours + exercices)Algo II :  les piles ( cours + exercices)
Algo II : les piles ( cours + exercices)Sana REFAI
 
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...Institut de l'Elevage - Idele
 

Dernier (8)

JTC 2024 - Réglementation européenne BEA et Transport.pdf
JTC 2024 - Réglementation européenne BEA et Transport.pdfJTC 2024 - Réglementation européenne BEA et Transport.pdf
JTC 2024 - Réglementation européenne BEA et Transport.pdf
 
JTC 2024 - DeCremoux_Anomalies_génétiques.pdf
JTC 2024 - DeCremoux_Anomalies_génétiques.pdfJTC 2024 - DeCremoux_Anomalies_génétiques.pdf
JTC 2024 - DeCremoux_Anomalies_génétiques.pdf
 
CAP2ER_GC_Presentation_Outil_20240422.pptx
CAP2ER_GC_Presentation_Outil_20240422.pptxCAP2ER_GC_Presentation_Outil_20240422.pptx
CAP2ER_GC_Presentation_Outil_20240422.pptx
 
Câblage, installation et paramétrage d’un réseau informatique.pdf
Câblage, installation et paramétrage d’un réseau informatique.pdfCâblage, installation et paramétrage d’un réseau informatique.pdf
Câblage, installation et paramétrage d’un réseau informatique.pdf
 
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdf
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdfJTC 2024 - SMARTER Retour sur les indicateurs de santé .pdf
JTC 2024 - SMARTER Retour sur les indicateurs de santé .pdf
 
JTC 2024 La relance de la filière de la viande de chevreau.pdf
JTC 2024 La relance de la filière de la viande de chevreau.pdfJTC 2024 La relance de la filière de la viande de chevreau.pdf
JTC 2024 La relance de la filière de la viande de chevreau.pdf
 
Algo II : les piles ( cours + exercices)
Algo II :  les piles ( cours + exercices)Algo II :  les piles ( cours + exercices)
Algo II : les piles ( cours + exercices)
 
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...
JTC 2024 - Leviers d’adaptation au changement climatique, qualité du lait et ...
 

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