COMPILER DESIGN

INTERMEDIATE CODE GENERATION

SYNTAX TREES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The lexical analyzer takes ____ as input and produces a stream of ____ as output.
A
Source program, tokens
B
Token, source program
C
Either A and B
D
None of the mentioned
Explanation: 

Detailed explanation-1: -The lexical analyzer takes as input and produces a stream of as output. Explanation: Lexical analyser takes source program as input and token as output.

Detailed explanation-2: -The lexical token is a string containing a unit of grammar used in the programming language expressed as a series of characters, and it is generated by the lexical analyzer. The Lexical Analyzer’s job and procedure is to tokenize the programme by dividing it into valid tokens and deleting all white space characters.

Detailed explanation-3: -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.