MCQ Bank
How is the attribute evaluation order determined in the oblivious methodology?
- A) Chosen at compiler design time
- B) Based on the syntax tree structure
- C) By considering the attribute dependencies
- D) By analyzing the attribute rules
Which two linear intermediate representations (IRs) are commonly used in modern compilers?
- A) High-level language and low-level language
- B) Stack-machine code and three-address code
- C) Register-transfer language and SSA form
- D) Assembly code and bytecode
What is the characteristic of the ordering of attribute evaluation in the rule-based methodology?
- A) It is fixed and determined at compiler-generation time.
- B) It is determined based on the values of the attributes.
- C) It is dynamically determined during the compilation process.
- D) It is randomly assigned during the dependency graph construction.
In the modified parser for the implementation of ad-hoc scheme for semantic analysis, what happens when a reduction by the production rule A → β occurs?
- A) The parser pops 2×|β| items from the stack.
- B) The parser pops 3×|β| items from the stack.
- C) The parser pushes 2×|β| items onto the stack.
- D) The parser pushes 3×|β| items onto the stack.
In attribute grammars, values used to compute inherited attributes flow ____________ in the parse tree.
- A) Top-down
- B) Bottom-up
- C) Top-up
- D) Bottom-down
What is the first step performed by the compiler application when using the dynamic method in attribute grammar evaluation?
- A) Constructing the parse tree
- B) Performing a topological sort
- C) Building the dependence graph
- D) Evaluating attributes in topological order
YACC is commonly used in the development of:
- A) Operating systems
- B) Compilers
- C) Web browsers
- D) Databases
How is a symbol table implemented?
- A) As a stack
- B) As a queue
- C) As an array
- D) As a hash table
In attribute grammars, attributes are distinguished based on the direction of value flow.
- A) False
- B) True
- C)
- D)
In syntax-directed translation, every time the parser encounters an identifier, it stores it in the _______________.
- A) Linear Array
- B) Parsing Stack
- C) Symbol table
- D) Priority Queue
In attribute grammars, a CFG is augmented with a set of ____________.
- A) Terminals
- B) Symbols
- C) Rules
- D) Non-terminals
Selecting an appropriate IR for a compiler project requires an understanding of both the source language and the target machine.
- A) False
- B) True
- C)
- D)
What does LALR(1) stand for?
- A) Look Ahead LL(1)
- B) Look Ahead RL(1)
- C) Look Ahead RR(1)
- D) Look Ahead LR(1)
What is the foundation of the ad-hoc scheme for semantic analysis?
- A) Formal language theory
- B) Abstract syntax trees
- C) Attribute grammars
- D) Compiler optimization techniques
In the oblivious methodology of attribute grammar evaluation, what is ignored during the compilation process?
- A) Attribute design considerations
- B) Attribute values
- C) Attribute dependencies
- D) Attribute rules and parse tree
Which of the following is NOT a typical use of attributed trees in compiler design?
- A) Error handling
- B) Type checking
- C) Optimization
- D) Syntax analysis
Stack-machine code and three-address code are mutually exclusive and cannot be used together in modern compilers.
- A) True
- B) False
- C)
- D)
In YACC, what does the notation $1 refer to?
- A) The second symbol on the left-hand side of a production.
- B) The first symbol on the right-hand side of a production.
- C) The first symbol on the left-hand side of a production.
- D) The second symbol on the right-hand side of a production.
Which tool uses the '$' notation to refer to values of symbols on the right-hand side of grammar productions?
- A) YACC
- B) Bison
- C) Flex
- D) Lex
If "A → B C D" is a production, then B is a child node of ____________ node.
- A) C
- B) B
- C) D
- D) A