(I) Backpatching can be used to generate code for Boolean expression in one pass.
(II) Backpatching can be used to generate code for flow-of-control statements in one pass.
Which ONE of the following options is CORRECT?
Correct : c
Backpatching is a technique used in compiler intermediate code generation to handle forward jumps when target addresses are not known initially. It allows these addresses to be filled in ("backpatched") later, so code generation can proceed in one pass.
Statement (I): Backpatching allows code generation for Boolean expressions (like those in conditional statements) in one pass, by linking together jump instructions whose targets aren’t known until later.
Statement (II): Backpatching also enables code generation for flow-of-control statements (such as if, while, for) in one pass, by managing jumps for control transfers.
Therefore, both statements are correct.
✅ Final Answer: Option (c) — Both (I) and (II) are correct.
Reason: Backpatching is used for both Boolean expressions and flow-of-control statements so that intermediate code can be generated efficiently in a single pass.
Similar Questions
Total Unique Visitors