next up previous
Next: Exercise 3. Up: Quiz11 Previous: Exercise 1.

Exercise 2.

We consider the following translation scheme.
S $ \longmapsto$ A {C.i := A.sC
S $ \longmapsto$ AB {C.i := A.sC
A $ \longmapsto$ int {A.s := int.val}
B $ \longmapsto$ id {}
C $ \longmapsto$ int {C.s := C.i + int.val}
where S, A, B, C are non-terminals, int and id are terminals, C.i is an inherited attribute, A.s and int.val are synthesized attributes. Write a YACC program for this translation scheme.

Answer 2  
\fbox{
\begin{minipage}{15 cm}
\mbox{ } \\
\mbox{ } \\
\mbox{ } \\
\mbox{...
...x{ } \\
\mbox{ } \\
\mbox{ } \\
\mbox{ } \\
\mbox{ } \\
\end{minipage}}


next up previous
Next: Exercise 3. Up: Quiz11 Previous: Exercise 1.
Marc Moreno Maza
2004-12-02