MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
For the rule B B1 and B2, the operation “B1.false = B.false” requires two passes as
A
B1.false is not known
B
B.false is not known
C
Both B1.false and B.false are unknown
D
None of the other options
Explanation: 

Detailed explanation-1: -One-pass code generation using backpatching Backpatching can be used to generate a program for boolean expressions and the flow of control statements in one pass. In this, synthesized attributes truelist and falselist of non-terminal B are used to handle labels in jumping code for Boolean expressions.

Detailed explanation-2: -26.2Functions to incorporate backpatching Makelist(), merge() and backpatch() are the three functions carried out in two passes to generate code using backpatching. makelist(i) – This is used to create a new list containing three-address location i, and it returns a pointer to the list.

Detailed explanation-3: -Backpatching is basically a process of fulfilling unspecified information. This information is of labels. It basically uses the appropriate semantic actions during the process of code generation. It may indicate the address of the Label in goto statements while producing TACs for the given expressions.

There is 1 question to complete.