Texts: Please, I want a clear answer. Please do it fast.
4. How is a DAG (directed acyclic graph) different from a syntax tree? Construct a DAG for the following three-address code:
i) a = b + c
ii) t1 = axa
iii) b = t1 + a
iv) c = t1xb
v) t2 = c + b
vi) a = t2 + t2
5. Explain syntax-directed translation to draw a syntax tree. Draw a syntax tree and DAG for a + a * b - c + b - c * 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;
}