COMPILER DESIGN

LEXICAL ANALYSIS

ROLE OF THE LEXICAL ANALYZER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The number of tokens in the Fortran statement:DO 10 I = 1.25 is
A
3
B
4
C
5
D
None of the above
Explanation: 

Detailed explanation-1: -∴ The number of tokens in the C statement is 5.

Detailed explanation-2: -So, total 10 tokens are there in the given statement.

Detailed explanation-3: -A Fortran statement consists of lexical tokens. These are keywords, names, operators, statement labels, literal constants (except complex literal constants), delimiter pairs as (…), /…/, ‘’…”, ‘…’, . … ., and (/…/), and finally, =, =>, &, :, ::, ; , and %.

Detailed explanation-4: -There are mainly six types of tokens which are supported by the C programming language, which are: Identifiers, Keywords, Constants, Strings, Operators, Special Symbols.

Detailed explanation-5: -C Tokens are of 6 types, and they are classified as: Identifiers, Keywords, Constants, Operators, Special Characters and Strings.

There is 1 question to complete.