Next:
Exercise 3.
Up:
Quiz2
Previous:
Exercise 1.
Exercise 2.
Consider the following syntax-directed definition for the point size and height of boxes containing mathematical formulas.
Production
Semantic Rule
S
B
B
.
ps
:= 10
S
.
ht
:=
B
.
ht
B
B
1
B
2
B
1
.
ps
:=
B
.
ps
B
2
.
ps
:=
B
.
ps
B
.
ht
:=
max
(
B
1
.
ht
,
B
2
.
ht
)
B
B
1
B
2
B
1
.
ps
:=
B
.
ps
B
2
.
ps
:=
shrink
(
B
.
ps
)
B
.
ht
:=
disp
(
B
1
.
ht
,
B
2
.
ht
)
B
B
.
ht
:=
.
h
×
B
.
ps
Write a translation scheme for this syntax-directed definition.
Answer 2
Next:
Exercise 3.
Up:
Quiz2
Previous:
Exercise 1.
Marc Moreno Maza
2004-12-02