4. How DAG (directed acyclic graph) is different from syntax tree? Construct a DAG for the
following three address code -
i). $a = b + c$
ii). $t1 = a \times a$
iii). $b = t1 + a$
iv). $c = t1 \times b$
v). $t2 = c + b$
vi). $a = t2 + t2$
5. Explain syntax directed translation to draw syntax tree. Draw syntax tree and DAG for
$a + a \times (b - c) + (b - c) \times d$
6. Generate code for the following C program using any code generation algorithm.
main()
{
int i, a, b, c, d, e;
i = a + b - (c + d) * e
}