Machine-translated by Google. Questions are authored in English.
Top

Discussion

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

  • A.Symbol table is responsible for keeping track of the scope of variables.
  • B.Symbol table can be implemented using a binary search tree.
  • C.Symbol table is not required after the parsing phase.
  • D.Symbol table is created during the lexical analysis phase.

Answer: C

The false statement is Symbol table is not required after the parsing phase.

The symbol table is used throughout compilation. Semantic analysis reads it for type checking and scope resolution, intermediate code generation and optimisation use the attributes it stores, and the code generator needs the storage locations and sizes recorded in it. So it is very much required after parsing.

The other statements are true. The symbol table records which declaration a name refers to in each scope. It can be implemented with a hash table, a list or a binary search tree. And entries are typically created as identifiers are first met in lexical analysis, with attributes filled in by later phases.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.