Machine-translated by Google. Questions are authored in English.
Top

Syntax Directed Translation Questions and Answers

81.

An attribute grammar in which all the attributes are..........is called an.......attributed grammar.

Exam Year(s)

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.

82.

In an L-attributed grammar, synthesized attributes are calculated using attributes from :

Exam Year(s)

MH SET - 2025, SET Exam - 2025,

Answer: C

Synthesized attributes are computed from attributes of the child non-terminals in the parse tree.

A synthesized attribute at a node is defined in terms of attributes of its children (and of the node itself), so values flow upward in the parse tree. This is true in L-attributed grammars as in any syntax-directed definition.

Attributes taken from the parent or from left siblings are inherited attributes, and the L-attributed restriction concerns these: an inherited attribute may depend only on the parent and on siblings to its left.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Syntax Directed Translation Questions and Answers || Syntax Directed Translation MCQ Questions and Answers || Syntax Directed Translation GK Questions and Answers || Syntax Directed Translation GK MCQ Questions || Syntax Directed Translation Multiple Choice Questions and Answers || Syntax Directed Translation GK || GK on Syntax Directed Translation || Compiler Design Questions and Answers || Compiler Design MCQ Questions and Answers || Compiler Design GK Questions and Answers || GK on Compiler Design