Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q1091: The attribute S.nextlist for the statement S → if E then M1 S1 N else M2 S2 is:
- A: merge(S1.nextlist, merge(N.nextlist, S2.nextlist))
- B: merge(E.truelist, E.falselist)
- C: E.truelist
- D: E.falselist
View Answer
A
Q1092: Fill in the blank: The quadruple for the assignment x = y + z is represented as ________.
- A: x=y+z
- B: goto _
- C: if x=y+z
- D: goto _
View Answer
A
Q1093: Fill in the blank: The quadruple index for the first quad after if a < b is ________.
- A: 100
- B: 106
- C: 108
- D: 102
View Answer
A
Q1094: Fill in the blank: The semantic action M → ε assigns ________ to M.quad.
- A: nextQuad()
- B: nil
- C: 0
- D: -1
View Answer
A
Q1095: Fill in the blank: The semantic action backpatch(E.truelist, M.quad) is used to patch ________.
- A: true list of E
- B: false list of E
- C: nextlist of S
- D: nextlist of N
View Answer
A
Q1096: Fill in the blank: In the example, the statement 108 corresponds to ________.
- A: x = y - z
- B: goto _
- C: if c < d
- D: goto _
View Answer
A
Q1097: Fill in the blank: The semantic action backpatch(E.falselist, M2.quad) connects the false list of E to the ________.
- A: else part
- B: then part
- C: next part
- D: next quad
View Answer
C
Q1098: Fill in the blank: The list-handling procedures used in backpatching are similar to those used in ________.
- A: Boolean expression translation
- B: Memory allocation
- C: Code optimization
- D: Parsing syntax
View Answer
A
Q1099: The semantic action backpatch([103,105],108) patches the false list to the quad index ________.
- A: 108
- B: 106
- C: 102
- D: 104
View Answer
A
Q1100: Fill in the blank: The backpatching technique helps to resolve ________ in generated intermediate code.
- A: jump targets
- B: variable scopes
- C: function calls
- D: error handling
View Answer
A