Failure of SDD Attribute Evaluation
In this class, We discuss the Failure of SDD Attribute Evaluation.
For Complete YouTube Video: Click Here
The reader should have prior knowledge of the dependency graph. Click Here.
The below diagram shows the syntax-directed definition and dependency graph for expression grammar.
We discussed the dependency graph in our previous class.
Is it possible to evaluate the attributes all the time during parsing? No.
An example explains the situation where the evaluation of attributes is not possible.
Example:
A – B { A.s = B.i, B.i= A.s + 1}
Take the above Syntax directed definition.
The below diagram shows the dependency graph for grammar A – B.
The dependency graph shows a cycle.
The evaluation is not possible whenever a cycle is formed in the dependency graph.
How do we eliminate cycles in the dependency graph?
There are a few conditions, and cycles are not formed if we follow those conditions.
The conditions to avoid cycles in the dependency graph are discussed in our next class.