✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Consider the following SDD for arithmetic expressions:
E → E1 + T { E.val = E1.val + T.val }E → T { E.val = T.val }T → id { T.val = lookup(id.lexeme) }
Suppose we want to evaluate the expression a + b + c, and the symbol table contains:lookup(a)=2, lookup(b)=3, lookup(c)=5.
If evaluation order strictly follows topological ordering of the dependency graph, what is the final computed value of E?