Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q1051: Fill in the blank: The translation scheme uses _______ lists to track incomplete jumps for boolean expressions.
- A: Truelist and falselist
- B: Label and variable lists
- C: True and false variables
- D: Jump and call lists
View Answer
A
Q1052: What is the output of the backpatch(p, i) function?
- A: Labels the gotos in list p with target i
- B: Combines lists p and i
- C: Deletes list p
- D: Generates new code
View Answer
A
Q1053: In boolean expressions, what does E → false generate?
- A: A goto to E.false
- B: A goto to E.true
- C: No code
- D: A conditional jump
View Answer
A
Q1054: Fill in the blank: The conditional jump generated by E → id1 relop id2 has _______ targets.
- A: Two
- B: One
- C: Zero
- D: Three
View Answer
A
Q1055: In the production E → id1 relop id2, what does E.truelist represent?
- A: A list containing the index of the next quadruple
- B: A list of variable names
- C: A list of labels
- D: A list of operators
View Answer
A
Q1056: What is the function of makelist(nextquad()) in syntax-directed translation?
- A: Creates a list with the current quadruple index
- B: Deletes a list
- C: Merges two lists
- D: Generates a label
View Answer
A
Q1057: Which quadruple is generated first in the boolean expression a < b or c < d and e < f?
- A: if a < b goto _
- B: goto _
- C: if c < d goto _
- D: goto _
View Answer
A
Q1058: After reduction of c < d to E, what does E.falselist contain?
- A: A list with quadruple index 103
- B: A list with quadruple index 102
- C: A list with quadruple index 104
- D: A list with quadruple index 105
View Answer
A
Q1059: What does the semantic action backpatch(E1.truelist, M.quad) do?
- A: Replaces the target of jumps in E1.truelist with M.quad
- B: Merges two lists
- C: Creates a new quadruple
- D: Deletes E1.truelist
View Answer
A
Q1060: In the production E → E1 and M E2, what is the resulting E.falselist?
- A: Merge of E1.falselist and E2.falselist
- B: E2.falselist only
- C: E1.falselist only
- D: Empty list
View Answer
A