The GATE Grind

GATE 2020 CS – Question 19

Compiler Design · Runtime Environments · 1 mark · Multiple choice

Consider the following statements.

I. Symbol table is accessed only during lexical analysis and syntax analysis.

II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment.

III. Errors violating the condition 'any variable must be declared before its use' are detected during syntax analysis.

Which of the above statements is/are TRUE?

  1. I only
  2. I and III only
  3. II only
  4. None of I, II, and III

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) None of I, II, and III

Explanation

The symbol table is also used in semantic analysis and code generation, so I is false. Recursion needs a stack, not a heap, so II is false. Declaration-before-use is a semantic check, so III is false.