Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q981: Which IR form is more concise than a parse tree but retains the structure of source code?
- A: Abstract Syntax Tree (AST)
- B: Directed Acyclic Graph (DAG)
- C: Three-address code
- D: Stack-machine code
View Answer
A
Q982: The IR form that represents the program in a graph form is called ______.
- A: Graphical IR
- B: Linear IR
- C: Hybrid IR
- D: Parse Tree
View Answer
A
Q983: Which IR form is closest to assembly language code?
- A: Linear IR
- B: Graphical IR
- C: Hybrid IR
- D: Source code
View Answer
A
Q984: Three-address code is attractive because it allows the compiler to reuse ______.
- A: names and values
- B: operators
- C: memory blocks
- D: registers
View Answer
A
Q985: The typical size of operations in three-address code is about ______ bytes.
- A: 1 to 2
- B: 2 to 3
- C: 3 to 4
- D: 4 to 5
View Answer
A
Q986: The typical size of addresses in three-address code is ______ bytes.
- A: 2
- B: 3
- C: 4
- D: 5
View Answer
C
Q987: In the production S → id = E, the translation scheme uses ______ to find the identifier.
- A: emit
- B: lookup
- C: newtemp
- D: install
View Answer
B
Q988: In the rule E → E1 + E2, a new temporary is created using ______.
- A: emit
- B: lookup
- C: newtemp
- D: install
View Answer
C
Q989: The translation scheme function that generates a three-address statement is called ______.
- A: lookup
- B: emit
- C: newtemp
- D: install
View Answer
B
Q990: The routine that checks if a name is in the symbol table is called ______.
- A: newtemp
- B: install
- C: lookup
- D: emit
View Answer
C