AllInfoHub Logo

AllInfoHub – MCQ Practice

Compiler Design – Multiple Choice Questions (MCQs)

  1. 49. Why is left recursion a problem for top-down parsers?

    • A. It can cause infinite loops
    • B. It makes bottom-up parsing difficult
    • C. It has no impact on parsing
    • D. It simplifies the grammar
  2. 50. How can left recursion be eliminated from a grammar?

    • A. By rewriting the grammar using iteration or right recursion
    • B. By removing the problematic production rules
    • C. By changing the parsing technique
    • D. By adding lookahead symbols
  3. 51. What is left factoring in a grammar?

    • A. A grammar transformation that groups productions with common prefixes
    • B. A grammar transformation that eliminates left recursion
    • C. A grammar transformation that simplifies the grammar
    • D. A grammar transformation that adds new non-terminals
  4. 52. What is the purpose of left factoring?

    • A. To make the grammar suitable for predictive parsing
    • B. To eliminate ambiguity
    • C. To reduce the size of the grammar
    • D. To improve the efficiency of code generation
  5. 53. What is a directed acyclic graph (DAG) in compiler design?

    • A. A graphical representation of basic blocks
    • B. A graphical representation of the symbol table
    • C. A graphical representation of the intermediate code that makes explicit the common subexpressions
    • D. A graphical representation of the parse tree
  6. 54. What is a basic block?

    • A. A sequence of consecutive statements in which control enters at the beginning and leaves at the end without any halt or possibility of branching except at the end
    • B. A single instruction
    • C. A loop in the program
    • D. A function definition