Chapter 5:Semantic Analysis

Determining set of possible types

When E is reduced to 3 or 5, lookup(id) returns i (integer) in both cases. Then * has three possible types:

ixi i

ixi c

cxc c

Then the rule E E 1 (E 2 ) is used on * where * is E 1 and 3,5 are E 2 . Since both 3,5 are of the type i, E.types in this case can be either i or c.