MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
This phase scans the source code as a stream of characters and converts it into meaningful lexemes.
A
Lexical Analyzer
B
Syntax Analyzer
C
Semantic Analyzer
D
Code Generator
Explanation: 

Detailed explanation-1: -This phase scans the source code as a stream of characters and converts it into meaningful lexemes.

Detailed explanation-2: -Lexical analysis is the starting phase of the compiler. It gathers modified source code that is written in the form of sentences from the language preprocessor. The lexical analyzer is responsible for breaking these syntaxes into a series of tokens, by removing whitespace in the source code.

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

Detailed explanation-4: -The first phase of the compiler is the lexical analyzer, also known as the scanner, which recognizes the basic language units, called tokens. The exact characters in a token is called its lexeme.

Detailed explanation-5: -Lexical analysis is the first phase of a compiler. It takes modified source code from language preprocessors that are written in the form of sentences. The lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code.

There is 1 question to complete.