Consider the following statements about the use of backpatching in a compiler…
2025
Consider the following statements about the use of backpatching in a compiler for intermediate code generation:
Backpatching can be used to generate code for Boolean expression in one pass
Backpatching can be used to generate code for flow-of-control statements in one pass
Which ONE of the following options is CORRECT?
- A.
Only (I) is correct
- B.
Only (II) is correct
- C.
Both (I) and (II) are correct
- D.
Neither (I) nor (II) is correct
Attempted by 38 students.
Show answer & explanation
Correct answer: C
Backpatching is a compiler technique that handles forward references during intermediate code generation. It enables one-pass compilation for Boolean expressions and flow-of-control statements by resolving jump targets later. Consequently, both provided statements regarding backpatching capabilities are correct.
A video solution is available for this question — log in and enroll to watch it.