Semantic Analysis:
Type
Checking
44/69
id
E
op
1)
Action:
E
.type :=
id
.type
E
2)
E
1
E
2
Rule:
Rule:
Operation
op
is
defined over types:
t
1
op
t
2
®
t
3
Action:
if
(
E
1
.type =
t
1
or
E
1
.type is convertable to
t
1
)
and
(
E
2
.type =
t
2
or
E
2
.type is convertable to
t
2
)
then
E
.type :=
t
3
else
Semantic Error
.