COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The output of intermediate code generator is the
A
Target code
B
Object code
C
Optimized code
D
Three address code
Explanation: 

Detailed explanation-1: -Three-Address Code Intermediate code generator receives input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree. That syntax tree then can be converted into a linear representation, e.g., postfix notation. Intermediate code tends to be machine independent code.

Detailed explanation-2: -Intermediate code can translate the source program into the machine program. Intermediate code is generated because the compiler can’t generate machine code directly in one pass. Therefore, first, it converts the source program into intermediate code, which performs efficient generation of machine code further.

Detailed explanation-3: -It gets its input from the semantic analysis phase and serves its output to the code optimizer phase. The intermediate code generator generates some intermediate representation. And from this intermediate representation, the compiler generates the target code.

Detailed explanation-4: -It can be in Abstract Syntax Tree (AST) structure, Reverse Polish Notation, or 3-address code.

There is 1 question to complete.