In a bottom-up evaluation of a syntax directed definition, inherited attributes can
- always be evaluated
- be evaluated only if the definition is L-attributed
- be evaluated only if the definition has synthesized attributes
- never be evaluated
Option $(3)$ should be true, since ,
Synthesized Attributes: They are computed from the values of the attributes of the children nodes.
Inherited Attributes: They are computed from the values of the attributes of both the siblings and the parent nodes.
But, one of my friends commented that "Your explanation is correct, but option C says "has" not "is"." (In fact, I did not get this comment).
Somewhere it explain as below:
A Syntax Directed Definition (SDD) is called S Attributed if it has only synthesized attributes.
L-Attributed Definitions contain both synthesized and inherited attributes but do not need to build a dependency graph to evaluate them. So, option $(2)$ is true.
Can you explain it in a formal way, please?