COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Symbol table
|
|
Lexical analysis
|
|
Syntactic analysis
|
|
Records
|
Detailed explanation-1: -A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table.
Detailed explanation-2: -Symbol Table is an important data structure created and maintained by the compiler in order to keep track of semantics of variables i.e. it stores information about the scope and binding information about names, information about instances of various entities such as variable and function names, classes, objects, etc.
Detailed explanation-3: -compiler needs to collect information about all the data objects that appear in the source program. The information about data objects is collected by the early phases of the compiler-lexical and syntactic analyzers. The data structure used to record this information is called as Symbol Table.
Detailed explanation-4: -There are three data structures used to implement symbol table: 1. Linear list 2. Binary tree 3. Hash table 1.
Detailed explanation-5: -The hash table consists of K entries from 0 to K − 1. These entries are a pointer to the symbol table pointing to the names of the symbol table. It can decide whether “Name” is in the symbol table we use a hash function ‘h’ including h (Name) will result in an integer between 0 to K − 1.