MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which phase is machine independent?
A
Analysis phase
B
Synthesis phase
C
Both the options
D
None of the options
Explanation: 

Detailed explanation-1: -The compilation is divided into two phases: Analysis (Machine Independent/Language Dependent) Synthesis (Machine Dependent/Language-Independent)

Detailed explanation-2: -Explanation: Machine independent phases are Lexical analysis, Syntax analysis, Semantic analysis, Intermediate code generation and sometime code optimization.

Detailed explanation-3: -Intermediate Code Generation is machine independent. Whereas, Target Code Generation or simply Code Generation is machine dependent because it has to finally convert the pure High Level Language compiler received initially to assembly code for an Assembler to process.

Detailed explanation-4: -Explore the Phases of Compiler The 6 phases of a compiler are: Lexical Analysis. Syntactic Analysis or Parsing. Semantic Analysis.

Detailed explanation-5: -Phase 4: Intermediate Code Generation Once the semantic analysis phase is over the compiler, generates intermediate code for the target machine. It represents a program for some abstract machine. Intermediate code is between the high-level and machine level language.

There is 1 question to complete.