Type Checking: Example 1/3
45/69
Rule: F ® i {F.type := i.type;
  generate(:=, i.loc, ,F.loc) }
Rule: Fi ® (Ej) {Fi.type := Ej .type}
• Make a type-checking for a grammar:
• Gexpr1 = (N, T, P, E), where N = {E, F, T}, T = {i, +, *, (, )},
  P = { E ® E+T, E ® T, T ® T*F, T ® F, F ® (E), F ® i }
• Operators *, + are defined as:
Rule: Ti ® Fj  {Ti.type := Fj .type}
Rule: Ei ® Tj  {Ei.type := Tj .type}
• int   * int   ®  int
• int   + int   ®  int
• real * real ®  real
• real + real ®  real
Possible Conversion:
• From int to real