COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

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: -Machine dependent code optimization is applied to object code. Machine-independent code optimization is applied to intermediate code. Machine dependent optimization involves CPU registers and absolute memory references. Machine independent code optimization does not involve CPU registers or absolute memory references.

Detailed explanation-4: -The Syntax Phase. The syntax analysis phase is often called the parser.

Detailed explanation-5: -Lexical Analysis. Syntactic Analysis or Parsing. Semantic Analysis. Intermediate Code Generation. Code Optimization. Code Generation.

There is 1 question to complete.