COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
When is the type checking usually done?
A
During syntax directed translation
B
During lexical analysis
C
During code optimization
D
During syntax analysis
Explanation: 

Detailed explanation-1: -Type checking is done during all the phases especially in syntax analysis phase.

Detailed explanation-2: -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-3: -The syntax-directed translation is useful in compiler design as it allows the designer to specify the generation of intermediate code directly into the terms of the syntactic structure of the source language. It divides it into synthesized and inherited grammar attributes.

There is 1 question to complete.