in Others edited by
873 views
0 votes
0 votes

Symbol table can be used for:

  1. Checking type compability
  2. Suppressing duplication of error message
  3. Storage allocation
  4. All of these above
in Others edited by
873 views

1 Answer

1 vote
1 vote

Option D All of these

Symbol table is an important data structure created and maintained by compilers in order to store information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc. Symbol table is used by both the analysis and the synthesis parts of a compiler.

A symbol table can be implemented in one of the following ways:

  • Linear (sorted or unsorted) list
  • Binary Search Tree
  • Hash table

A symbol table may serve the following purposes depending upon the language in hand:

  • To store the names of all entities in a structured form at one place.

  • To verify if a variable has been declared.

  • To implement type checking, by verifying assignments and expressions in the source code are semantically correct.

https://www.geeksforgeeks.org/symbol-table-compiler/

Related questions