COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In an compiler, the data structure used for storing and managing information about variables and their attributes is
A
abstract syntaxt tree
B
symbol table
C
semantic stack
D
parser table
Explanation: 

Detailed explanation-1: -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.

Detailed explanation-2: -There are three data structures used to implement symbol table: 1. Linear list 2. Binary tree 3. Hash table 1.

Detailed explanation-3: -Symbol table is an important data structure used in a compiler. Symbol table is used to store the information about the occurrence of various entities such as objects, classes, variable name, interface, function name etc. it is used by both the analysis and synthesis phases.

Detailed explanation-4: -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.

There is 1 question to complete.