Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q921: Attribute grammars help to compute ________ in compiler design.
- A: Semantic values
- B: Lexical tokens
- C: Parsing tables
- D: Syntax errors
View Answer
A
Q922: The attribute List.val for List → Bit is computed as ________.
- A: Bit.val
- B: List.pos
- C: Bit.pos
- D: Number.val
View Answer
A
Q923: The attribute Sign.neg is assigned false when Sign → ________.
- A: +
- B: –
- C: 0
- D: 1
View Answer
A
Q924: The attribute Number.val when Sign.neg is false is assigned as ________.
- A: List.val
- B: –List.val
- C: Sign.neg
- D: 0
View Answer
A
Q925: The attribute dependence graph is derived from ________.
- A: Rules and parse tree
- B: Token stream
- C: Lexical analyzer
- D: Symbol table
View Answer
A
Q926: The attribute Bit.pos in the parse tree is always assigned relative to ________.
- A: List.pos
- B: Sign.neg
- C: Number.val
- D: Bit.val
View Answer
A
Q927: In the dynamic method of attribute evaluation, the compiler builds the parse tree and then builds ________.
- A: The dependence graph
- B: The syntax tree
- C: The symbol table
- D: The lexical analyzer
View Answer
A
Q928: In dynamic method, attributes are evaluated in ________ order.
- A: Topological
- B: Reverse topological
- C: Random
- D: Lexical
View Answer
A
Q929: Rule-based (or treewalk) methodology determines a ________ ordering at compiler generation time.
- A: Fixed (static)
- B: Dynamic
- C: Random
- D: Topological
View Answer
A
Q930: Oblivious (passes, dataflow) methodology ________ the attribute rules and parse tree.
- A: Ignores
- B: Analyzes
- C: Builds dependency graph
- D: Sorts topologically
View Answer
A