Type checking is naturally expressed as a syntax directed translation because
Answer: C
Correct answer: the type of an expression is synthesised from those of its operands
The type of a sum follows from the types of its two operands, which follow from theirs, all the way down to the identifiers and constants. That is a purely synthesised computation, so type checking fits an S-attributed definition and can be done during a bottom up parse.
Please log in or register to report this question.