Explain the role of lexical analyzer in compiler design. What is input buffering? Describe the buffer-pair scheme with sentinels and explain why it is efficient.
Design a lexical analyzer using transition diagram that recognizes:
Identifiers (letter followed by letters/digits)
Integer constants
Operators: +, -, *, /, <, <=, >, >=, ==, =
Keywords: if, then, else, while
Show the transition diagram and write pseudocode for the nextToken() function.