Bits
Bits
2. Which of the following types of grammars are associated with regular languages?
A) Type 0 B) Type 1 C) Type 2 D) Type 3
A. Machine-level optimization
B. Peephole optimization
C. Loop optimization
D. Syntax optimization
5. Which of the following is NOT typically considered a part of semantic analysis in NLP?
9. Which optimization technique is used to minimize the number of instructions that access memory?
A. Loop interchange
B. Common subexpression elimination
C. Loop fusion
D. Register allocation
A. Constant folding
B. Dead code elimination
C. Loop-invariant code motion
D. Instruction scheduling
A. To increase the size of the loop body and reduce the number of iterations
B. To remove unnecessary loop conditions
C. To merge multiple loops into a single loop
D. To eliminate redundant code in loops
14. Which of the following storage areas is typically used for storing function call information,
including local variables and function parameters?
A) The heap B) The stack C) The data segment D) The text segment
15. In which phase of the compiler is intermediate code translated into machine code?
A. Lexical Analysis
B. Syntax Analysis
C. Code Optimization
D. Code Generation
16. Which of the following is responsible for managing memory during program execution?
A) Compiler front-end B) Compiler back-end C) Operating system D) Runtime system
19. Which of the following is generated in the intermediate code generation phase of a compiler?
A. Assembly code
B. Object code
C. High-level programming language code
D. Intermediate code (such as Three-address code)
22. Which of the following techniques can help to eliminate redundant calculations in a program?
27. The primary goal of the code generation phase in a compiler is to:
28. Which of the following is NOT typically a part of the code generation phase?
30. Which type of instruction is commonly used in a three-address code representation in intermediate
code generation?
31. In the context of DAG in compiler design, what does each node typically represent?
A) An operand or a result of a computation. B) A variable that holds the result of an expression.
C) A function or method in the program. D) A basic block of the program.
32. Which of the following automata is capable of recognizing context-free languages (Type 2)?
A) Finite automaton B) Turing machine C) Pushdown automaton D) Linear-bounded automaton