Skip to content
GATEiit

GATE CSE 2020 Q19: Symbol table use, heap for recursion, declare-before-use errors

Question

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?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: D (official GATE 2020 final answer key)

Concept used: Compiler phases: what each phase uses and which errors it can detect.

First step: Recursion needs a stack, not a heap; declare-before-use is a semantic check; and the symbol table is used in later phases too.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2020 CS question paper and final answer key, organised by IIT Delhi. Question paper · Answer key