COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Lexical Analysis
|
|
Syntax Analysis
|
|
Syntax Directed Translation
|
|
Code generation
|
Detailed explanation-1: -Type checking is done during all the phases especially in syntax analysis phase. 3. Target code generation phase is machine independent code generation.
Detailed explanation-2: -Explanation: Type checking is done during syntax-directed translation.
Detailed explanation-3: -Explanation: Type checking is done at semantic analysis phase and parsing is done at syntax analysis phase.
Detailed explanation-4: -Type checking is the process of verifying and enforcing constraints of types in values. A compiler must check that the source program should follow the syntactic and semantic conventions of the source language and it should also check the type rules of the language.
Detailed explanation-5: -Explanation: Type checking performs at semantic analysis phase, and parsing performs at the syntax analysis phase. Since Syntax analysis phase comes before semantic analysis, therefore Type Checking is always done after parsing.