A phase of a compiler which produce the symbol table is

2026

A phase of a compiler which produce the symbol table is

  1. A.

    Syntax analysis

  2. B.

    Semantic analysis

  3. C.

    Target code generation

  4. D.

    Code optimization

Attempted by 173 students.

Show answer & explanation

Correct answer: B

The concept needs careful understanding. The symbol table is primarily created during the lexical analysis phase, where identifiers are first recognized and entered. However, in this question, lexical analysis is not provided as an option. In such cases, we must choose the closest relevant phase. Among the given options, semantic analysis is the best choice because it actively uses and updates the symbol table for tasks like type checking, declaration validation, and scope resolution. Syntax analysis only verifies grammatical structure, while code generation and optimization do not deal with symbol table handling. Hence, Option B (Semantic Analysis) is the most appropriate answer here.

Explore the full course: Mppsc Assistant Professor