COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The output of the lexical analyzer is ____
A
string character
B
a syntax tree
C
a set of RE
D
a set of tokens
Explanation: 

Detailed explanation-1: -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-2: -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-3: -Solution: (D). (1) The output of the lexical analyzer is tokens.

Detailed explanation-4: -A parse tree. Intermediate code. Machine code. A stream of tokens.

There is 1 question to complete.