MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Information about source program is stored in
A
operating system
B
symbol table
C
interpreter
D
database
Explanation: 

Detailed explanation-1: -In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier (or symbol), constant, procedure and function in a program’s source code is associated with information relating to its declaration or appearance in the source.

Detailed explanation-2: -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-3: -A symbol table is a data structure maintained and constructed by the Python compiler that contains all of the essential information about each identifier found in the source code of the program. This data pertains to an identifier’s type, value, scope level, and its position (also called symbol).

Detailed explanation-4: -From what i understand the symbol table stores the variable name and the some details like the type, scope etc.So a character 0 is found by the Lexical analyzer, it matches the pattern for a number so it uses the tokenname number so token becomes <number, attrb> .

Detailed explanation-5: -A fixed space for each name is allocated in symbol table. In this type of storage, if name is too small then there is wastage of space. The name can be referred by pointer to symbol table entry.

There is 1 question to complete.