LEXICAL ANALYSIS
ROLE OF THE LEXICAL ANALYZER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Machine Code
|
|
Intermediate Code
|
|
Stream of Token
|
|
Parse Tree
|
Detailed explanation-1: -Explanation: The lexical analyzer produces a list of tokens as output.
Detailed explanation-2: -What is the output of lexical analyzer? Explanation: A lexical analyzer coverts character sequences to set of tokens.
Detailed explanation-3: -The lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code. If the lexical analyzer finds a token invalid, it generates an error. The lexical analyzer works closely with the syntax analyzer.
Detailed explanation-4: -The lexical analyzer generates tokens as output for the parser for each lexeme, and tokens are expressed in regular expressions. So, a simple Finite Automata is sufficient for it. Hence the correct answer is Finite automata.