INTERMEDIATE CODE GENERATION
SYNTAX TREES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
The output of a lexical analyzer is?
|
A parse tree
|
|
Machine code
|
|
A stream of tokens
|
|
Intermediate code
|
Explanation:
Detailed explanation-1: -What is the output of lexical analyzer? Explanation: A lexical analyzer coverts character sequences to set of tokens.
Detailed explanation-2: -Solution: (D). (1) The output of the lexical analyzer is tokens.
Detailed explanation-3: -Lexical Analysis is the first phase of compiler also known as scanner. It converts the High level input program into a sequence of Tokens. Counting all the boxes, the total number of tokens comes out to be 26.
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.
There is 1 question to complete.