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.

II only

D.

None of I, II and III

Solution:

Statement I: False, Symbol table is accessed by all the phases of Compiler

Statement II: False, compilers don’t necessarily need heap storage for memory allocation in runtime, either stack or heap is needed.

Statement III: False, such errors are detected by the sematic analysis.