COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Ambiguous grammar
|
|
Unambiguous grammar
|
|
LL grammar
|
|
LR grammar
|
Detailed explanation-1: -9. Through which type of grammar can synthesized attributes can be simulated? Explanation: Through LR grammar synthesized attributes can be simulated.
Detailed explanation-2: -Synthesized attribute is an attribute whose parse tree node value is determined by the attribute value at child nodes.To illustrate, assume the following production S → ABC if S is taking values from its child nodes (A, B, C), then it is said to be a synthesized attribute, as the values of ABC are synthesized to S.
Detailed explanation-3: -An attribute is said to be Synthesized attribute if its parse tree node value is determined by the attribute value at child nodes. An attribute is said to be Inherited attribute if its parse tree node value is determined by the attribute value at parent and/or siblings node.
Detailed explanation-4: -S-attributed SDT. If an SDT uses only synthesized attributes, it is called as S-attributed SDT. Inherited attributes: An attribute of a nonterminal on the right-hand side of a production is called an inherited attribute. The attribute can take value either from its parent or from its siblings.
Detailed explanation-5: -AT A PARSE TREE NODE, following the previous definition, the value of a synthesized attribute is computed from the values of the attributes of the children of the node. the value of an inherited attributes is computed from the values of the attributes of its siblings (brothers and sisters) and parents.