LEXICAL ANALYSIS
ROLE OF THE LEXICAL ANALYZER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
symbol table
|
|
divided into two halves
|
|
divided into Three halves
|
|
not divided
|
Detailed explanation-1: -A buffer can be divided into two halves. If the look Ahead pointer moves towards halfway in First Half, the second half is filled with new characters to be read. If the look Ahead pointer moves towards the right end of the buffer of the second half, the first half will be filled with new characters, and it goes on.
Detailed explanation-2: -When referring to computer memory, the input buffer is a location that holds all incoming information before it continues to the CPU for processing. Input buffer also describes other hardware or software buffers used to store information before it is processed.
Detailed explanation-3: -One Buffer Scheme: 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 part of lexeme.
Detailed explanation-4: -To ensure that a right lexeme is found, one or more characters have to be looked up beyond the next lexeme. Hence a two-buffer scheme is introduced to handle large lookaheads safely.