Which ONE of the following statements is FALSE regarding the symbol table?
View worked solution
Answer: C
To determine which statement is FALSE, let us analyze each option regarding the symbol table:
- Option A: "Symbol table is responsible for keeping track of the scope of variables."
True. In block-structured languages, the symbol table must manage nested scopes (e.g., using a stack of tables or scope markers) to ensure identifiers are resolved to their correct declarations. - Option B: "Symbol table can be implemented using a binary search tree."
True. While hash tables are the most common implementation due to average search time, self-balancing binary search trees (like AVL or Red-Black trees) are also valid and provide search/insertion guarantees. - Option C: "Symbol table is not required after the parsing phase."
False. The symbol table is a central data structure used throughout the entire compilation process. It is heavily used during semantic analysis (for type checking), intermediate code generation, and target code generation (to determine memory offsets and address allocation). - Option D: "Symbol table is created during the lexical analysis phase."
True. The symbol table is initialized and populated as soon as the lexical analyzer (lexer) identifies tokens representing identifiers.
Therefore, statement C is false.
Free practice · Your answers on this page are not saved.
