Step 1: Understanding type checking.
Type checking ensures that operations in a program are applied to compatible data types, such as preventing addition of an integer and a string.
Step 2: Role of compiler phases.
Lexical analysis identifies tokens, while syntax analysis checks grammatical structure. Neither phase checks semantic correctness like type compatibility.
Step 3: Syntax-directed translation.
Type checking is part of semantic analysis, which is implemented using syntax-directed translation with attributes attached to grammar symbols.
Step 4: Final conclusion.
Hence, type checking is normally performed during syntax-directed translation.