COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
During syntax directed translation
|
|
During lexical analysis
|
|
During code optimization
|
|
During syntax analysis
|
Detailed explanation-1: -Type checking is done during all the phases especially in syntax analysis phase.
Detailed explanation-2: -Explanation: Type checking is done during syntax-directed translation.
Detailed explanation-3: -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.
Detailed explanation-4: -B) Type checking is done during syntax analysis phase.
Detailed explanation-5: -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.