/    /  Compiler Design-Buffer Pairs

Buffer Pairs

 

Specialized buffering techniques were developed to reduce the amount of overhead required to process an input character because of the large amount of time that is consumed in shifting characters.

 

Scheme:

  • It consists of two buffers, each buffer has a capacity for n-characters which are reloaded alternatively. 
  • The characters are read from the source file or the input file to the buffer using system read command 

 

Disadvantages

  • The amount of lookahead is limited. 
  • The limited lookahead may make it difficult to identify tokens in circumstances where the length that the forward pointer must travel is more than the length of the buffer.
  •  It cannot determine whether the word present is a keyword or an array name until the right parenthesis is detected.

 

Reference Link

Buffer Pairs