Skip to content
Official PYQ · 1991

GATE CS 1991 Q03 — Runtime Environments

Explain with AI

Indicate all the true statements from the following:

Select all correct options
View worked solution

Answer: A;D

Let us analyze each statement individually to determine its correctness:

  1. Recursive descent parsing cannot be used for grammar with left recursion.
    True: Top-down parsers, including recursive descent, cannot handle left-recursive grammars because a production of the form A→AαA \to A\alpha leads to an infinite loop of function calls for non-terminal AA without consuming any input.
  2. The intermediate form for representing expressions which is best suited for code optimization is the postfix form.
    False: Postfix notation (reverse Polish notation) is linear and lacks explicit structure, making it difficult to perform optimizations like common subexpression elimination, loop optimization, or register allocation. Three-address code (TAC) or Directed Acyclic Graphs (DAGs) are much better suited for code optimization.
  3. A programming language not supporting either recursion or pointer type does not need the support of dynamic memory allocation.
    False: Even without recursion or pointers, a language may support features like dynamic arrays (where the array size is determined at runtime) or dynamic string manipulation, which require dynamic memory allocation (e.g., on the heap or dynamic stack).
  4. Although C does not support call-by-name parameter passing, the effect can be correctly simulated in C.
    True: Call-by-name can be simulated in C using thunks. A thunk is a parameterless function passed as an argument (via a function pointer) that evaluates the expression in the caller's context whenever the parameter is referenced in the callee.
  5. No feature of Pascal typing violates strong typing in Pascal.
    False: Pascal has variant records (specifically, untagged variant records) which allow different types of data to share the same memory space without runtime type-safety checks. This violates strong typing.

Thus, the true statements are A and D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Runtime Environments questions