edited by
8,201 views
23 23 votes

Which ONE of the following statements is FALSE regarding the symbol table?

  1. Symbol table is responsible for keeping track of the scope of variables.
  2. Symbol table can be implemented using a binary search tree.
  3. Symbol table is not required after the parsing phase.
  4. Symbol table is created during the lexical analysis phase.

6 Answers

6 6 votes

Symbol table-A data structure
1.Symbol table--it stores all identifiers(s variable names, function names) and their attributes along with it.
2.start from lexical phases and used till phase code optimization.
3. symbol table created during lexical analysis phaseaccessible by all phases manipulated by all phases if needed,or saying  Symbol table is used by both the analysis and the synthesis parts of a compiler.
or saying it is used by both front end and backend part of the compiler phases
4.also created by two pass assembler in their first pass
5.Implementation-can be implementation by using array, hash table, tree and linked lists.
-->If a compiler is to handle a small amount of data, then the symbol table can be implemented as an unordered list, which is easy to code, but it is only suitable for small tables only. A symbol table can be implemented in one of the following ways:
1.Linear (sorted or unsorted) list
2.Binary Search Tree
3.Hash table
Among all, symbol tables are mostly implemented as hash tables, where the source code symbol itself is treated as a key for the hash function and the return value is the information about the symbol.
6.Symbol table implement by hash table mostly and in hash table occupational density is  number of entries/length.

7.

A Symbol Table in programming is used for:

*Checking Type Compatibility*: The symbol table stores the data type of identifiers, which is used during semantic analysis to check if the expressions and assignments are semantically correct.
Suppressing Duplication of Error Messages: Symbol tables can help in managing errors. For instance, if a variable is declared twice, the symbol table can help detect this error and suppress duplicate error messages.
Storage Allocation: The symbol table can store information about the memory locations of identifiers, which can be used for storage allocation

 

5 5 votes

(C) Symbol table is not required after the parsing phase.

This statement is FALSE. Symbol table is used/accessed by all 7 phases of compiler.
and option A,B,D are TRUE. 

4 4 votes
Symbol table is created during the lexical analysis phase to keep track of information about the variables like scope and lifetime, which can also be implemented using binary search tree and is required in all the phases of compiles.

Hence, option-c
0 0 votes
Answer: "Symbol table is not required after the parsing phase" is FALSE.

Explanation:
- Symbol table tracks variable scope → TRUE
- It can be implemented using a BST → TRUE
- It is created/updated during lexical analysis → TRUE
- It is not required after parsing → FALSE

The symbol table is also used in later phases such as semantic analysis,
intermediate code generation, and code optimization.

Hence, the correct answer is:

"Symbol table is not required after the parsing phase" is FALSE.
Answer:
Position:
Show:

Related questions

22 22 votes
5 5 answers
6.8k
6.8k views
Arjun asked Feb 27, 2025
6,813 views
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?Run-time function call managementRegister assignment to variablesStre...
17 17 votes
2 answers 2 answers
7.2k
7.2k views
Arjun asked Feb 27, 2025
7,241 views
Refer to the given $3$-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is ________. (Answer in integer)1001: i = 1 1002: ...
1 1 vote
1 1 answer
2.2k
2.2k views
Arjun asked Jul 2, 2019
2,187 views
Which data structure is used by the compiler for managing variables and their attributes?Binary treeLink listSymbol tableParse table
19 19 votes
3 3 answers
5.8k
5.8k views
Arjun asked Feb 27, 2025
5,845 views
The CEO's decision to downsize the workforce was considered $\underline{myopic}$ because it sacrificed long-term stability to accommodate short-term gains.Select the most...