SYNTAX ANALYSIS
ROLE OF THE PARSER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Linear list
|
|
Search Tree
|
|
Hash Table
|
|
Self-Organization list
|
Detailed explanation-1: -Identify the data structure which is based on the locality of reference used for implementation of the symbol table. Explanation: A self-organizing list is based on the locality of reference.
Detailed explanation-2: -Symbol tables are often implemented as hash tables because a compiler must be able to store and retrieve information about symbols very quickly. Several parts of a compiler access the symbol table during various phases of the compilation process. One part, the lexical analyzer, inserts symbols.
Detailed explanation-3: -Hash tables are usually used to organise a symbol table, where the keyword or identifier is ‘hashed’ to produce an array subscript. Collisions are inevitable in a hash table, and a common way of handling them is to store the synonym in the next available free space in the table.
Detailed explanation-4: -Answer. 1-Self Organizing List. The aim of a self-organizing list is to improve efficiency of linear search by moving more frequently accessed items towards the head of the list. The property of frequently accessing same values, or related storage locations is termed as Locality of Reference.