in Compiler Design recategorized by
265 views
0 votes
0 votes

Symbol Table can be used for :

  1. Checking type compatibility
  2. Suppressing duplication of error message
  3. Storage allocation
  4. All of these
in Compiler Design recategorized by
265 views

1 Answer

0 votes
0 votes

(D) A Symbol Table in programming is used for:

  1. 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.

  2. 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.

  3. Storage Allocation: The symbol table can store information about the memory locations of identifiers, which can be used for storage allocation

Related questions