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

Symbol Table Management Questions and Answers

Answer: C

Declarations are local to their block and to any blocks nested within it. This is what makes a chained or stacked table the natural implementation. Flat tables can only support such a language by tagging every entry with its block.

Please log in or register to report this question.

Answer: D

Correct answer: holds every declared name including those local to procedures

A compiler needs every name in order to translate the code, including locals that exist only within one procedure. A dynamic loader needs only the names visible between modules - the exported and imported ones - so its table is far smaller and is built from what the compiler chose to emit.

Please log in or register to report this question.

Answer: A

Every identifier occurrence causes a lookup while each causes at most one insertion. Ordered iteration is needed only by cross reference tools, not by the compiler itself. Optimising for the wrong operation is a classic implementation mistake.

Please log in or register to report this question.

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.

Please log in or register to report this question.

Loading…
Tags: Symbol Table Management Questions and Answers || Symbol Table Management MCQ Questions and Answers || Symbol Table Management GK Questions and Answers || Symbol Table Management GK MCQ Questions || Symbol Table Management Multiple Choice Questions and Answers || Symbol Table Management GK || GK on Symbol Table Management || Compiler Design Questions and Answers || Compiler Design MCQ Questions and Answers || Compiler Design GK Questions and Answers || GK on Compiler Design