MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
____ is used in the several stages of the compiler.
A
Table
B
Symbol table
C
Records
D
Program
Explanation: 

Detailed explanation-1: -Which phase of the compiler does use a symbol table? The information in the symbol table is entered in the lexical analysis and syntax analysis phase. However, it is used in later compiler phases (semantic analysis, intermediate code generation, code optimization, and code generation).

Detailed explanation-2: -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-3: -Symbol table is used by both the analysis and the synthesis parts of a compiler. A symbol table may serve the following purposes depending upon the language in hand: To store the names of all entities in a structured form at one place. To verify if a variable has been declared.

Detailed explanation-4: -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-5: -3. What is the use of a symbol table in compiler design? Explanation: Both the analysis and synthesis components of a compiler use the symbol table. i) To keep all of the names of all entities in one place in a systematic format.

There is 1 question to complete.