An attribute grammar in which all the attributes are..........is called an.......attributed grammar.
MH SET - 2023, SET Exam - 2023,
Answer: A
The blanks are Synthesized, S: an attribute grammar in which all attributes are synthesized is S-attributed.
A synthesized attribute of a node is computed from the attributes of its children, so an S-attributed grammar can be evaluated bottom-up, during LR parsing, in one pass.
An L-attributed grammar is the wider class that also allows inherited attributes, but only those depending on the parent and on siblings to the left. So 'Synthesized, L' and 'Inherited, L' mismatch the definition, and 'Inherited, S' contradicts it, since S-attributed grammars have no inherited attributes at all.
Please log in or register to report this question.