Consider the following statements. I. Symbol table is accessed only during…

2020

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 ?

Answer: D. None of Ⅰ, Ⅱ and ⅢCorrect answer: None of I, II and III. Statement I is false: the symbol table is used throughout compilation — during lexical/syntax phases and especially…

  1. A.

    I only

  2. B.

    I and III only

  3. C.

    Ⅱ only

  4. D.

    None of Ⅰ, Ⅱ and Ⅲ

Attempted by 103 students.

Show answer & explanation

Correct answer: D

Correct answer: None of I, II and III.

  • Statement I is false: the symbol table is used throughout compilation — during lexical/syntax phases and especially during semantic analysis, intermediate-code generation, optimization, and code generation.

  • Statement II is false: recursion requires activation records to be maintained (a call stack) for each invocation; heap storage is for dynamic allocation and is not necessarily required to support recursion.

  • Statement III is false: 'variable must be declared before its use' is a semantic rule checked during semantic analysis (name resolution), not a syntactic rule detected by syntax analysis.

Therefore none of the three statements is true.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…