Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE CS 2020 | Question 19

  • Difficulty Level : Medium
  • Last Updated : 01 Sep, 2021

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 ?
(A) I only
(B) I and III only
(C) Ⅱ only
(D) None of Ⅰ, Ⅱ and Ⅲ


Answer: (D)

Explanation: I. False. Symbol Table is used by all 6 phases of compiler: lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and target code generation phase.

II. False. Heap allocation is used to dynamically allocate memory to the variables. Heap allocation can be used for recursion, but recursion is also supported in Stack allocation.

III. False. Syntax analysis checks only syntax, but variable declare before its use must be done by Semantic analyses.

Option (D) is correct.



Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!