COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Analysis phase
|
|
Synthesis phase
|
|
Both
|
|
None of the above
|
Detailed explanation-1: -The Analysis stage of a compiler is machine-independent and language-dependent, while the synthesis stage is machine-dependent and language-independent.
Detailed explanation-2: -The synthesis phase creates an equivalent target program from the intermediate representation. Symbol Table – It is a data structure being used and maintained by the compiler, consisting of all the identifier’s names along with their types. It helps the compiler to function smoothly by finding the identifiers quickly.
Detailed explanation-3: -There are 6 phases in the compiler, namely, lexical analysis, syntax analysis, semantics analysis, intermediate code generation, code optimization, and code generation. Symbol table is a data structure that the compiler generates and maintains to keep track of the semantics of variables.
Detailed explanation-4: -Semantic Analysis: In the process of compilation, semantic analysis is the third phase.
Detailed explanation-5: -Phase 4: Intermediate Code Generation Once the semantic analysis phase is over the compiler, generates intermediate code for the target machine. It represents a program for some abstract machine. Intermediate code is between the high-level and machine level language.