MCQ Bank
Which of the following information is typically stored in a symbol table?
- A) Name and value of variables
- B) Execution order of functions
- C) Assembly instructions
- D) Source code comments
What does the symbol table use to uniquely identify each symbol?
- A) Location
- B) Scope
- C) Type
- D) Name
YACC was originally developed at:
- A) IBM Research
- B) Google Research
- C) AT&T Bell Laboratories
- D) Microsoft Research
Three-address code is designed to minimize memory usage by using short representations for operations and addresses.
- A) False
- B) True
- C)
- D)
What purpose does the topological sort serve in the dynamic method of attribute grammar evaluation?
- A) It builds the dependence graph.
- B) It defines the order of attribute evaluation.
- C) It constructs the parse tree.
- D) It ensures the absence of circular dependencies.
What is the primary advantage of using three-address code as an intermediate representation (IR)?
- A) It ensures that each instruction has a maximum of three arguments.
- B) It reduces the number of instructions required for complex operations.
- C) It enables efficient memory management in the compiled code.
- D) It simplifies the process of debugging the compiled code.
Which section in a YACC specification file contains the "c/c++ functions"?
- A) Third Section
- B) Fourth Section
- C) First Section
- D) Second Section
How are the nodes in the dependency graph evaluated in the rule-based methodology of attribute grammar evaluation?
- A) In a bottom-up order
- B) In a random order
- C) In a topological order
- D) In an order specified by the attribute rules
Code optimization is essential to enhance the execution and efficiency of a source code.
- A) False
- B) True
- C)
- D)
In attribute grammars, each symbol in the derivation has a set of values or attributes.
- A) True
- B) False
- C)
- D)
YACC-generated parsers are based on which formal notation?
- A) Abstract Syntax Trees
- B) Backus Naur Form
- C) Regular Expressions
- D) Chomsky Hierarchy
In attribute grammars, rules and parse tree define an attribute dependence ____________ which must be acyclic.
- A) Stack
- B) List
- C) Table
- D) Graph
How does the symbol table help in detecting undefined symbols?
- A) By checking if symbols are declared before they are used
- B) By performing lexical analysis of the source code
- C) By identifying symbols with missing type information
- D) By associating symbols with their memory locations
Different compilers always use the same intermediate representation (IR) during the compilation process.
- A) False
- B) True
- C)
- D)