COMPILER DESIGN

INTRODUCTION TO COMPILER DESIGN

COMPILATION PROCESS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Removing whitespace is in:
A
Lexical Analysis
B
Syntax Analysis
C
Code Generation
D
Code Optimisation
Explanation: 

Detailed explanation-1: -The lexical analyzer is responsible for removing the white spaces and comments from the source program. It corresponds to the error messages with the source program. It helps to identify the tokens. The input characters are read by the lexical analyzer from the source code.

Detailed explanation-2: -Whitespace. Whitespace is composed of strings of Unicode SPACE, CHARACTER TABULATION, FORM FEED (FF), LINE FEED (LF) and CARRIAGE RETURN (CR) characters. Outside of a comment, string literal, or single quoted literal, whitespace acts as a token separator and is immediately discarded by the lexer.

Detailed explanation-3: -Roles of the Lexical analyzer Removes white spaces and comments from the source program.

Detailed explanation-4: -Lexeme. A lexeme is a sequence of characters in the source program that matches the pattern for a token and is identified by the lexical analyzer as an instance of that token.

There is 1 question to complete.