COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
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. Now see the below given data structures:I. Linear ListII. Hash TableIII. Heap TreeIV. Binary Search TreeAmong the above data structures, which data structure(s) can be used to store the symbol table?
A
Only I
B
Only I and II
C
Only II, III, IV
D
Only I, II and IV
Explanation: 

Detailed explanation-1: -The symbol table is used to store essential information about every symbol contained within the program. Virtually every phase of the compiler will use the symbol table: The initialization phase will place keywords, operators, and standard identifiers in it.

Detailed explanation-2: -There are three data structures used to implement symbol table: Linear List. Binary Search Tree. Hash Table.

Detailed explanation-3: -flexible in structure. efficient use of space. handle characteristics of language (e.g., scoping, implicit declaration) Declarative statements-define identifiers and their attributes. Imperative statements-uses identifiers assuming their attributes. More items •22-Sept-2015

There is 1 question to complete.