MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If the attributes of the parent depend on the attributes of the children, then they are called as ____ attributes.
A
made
B
discovered
C
new
D
inherited
Explanation: 

Detailed explanation-1: -An attribute of a node (non-terminal) that depends on the value of attributes of children nodes in the parse tree is called inherited attribute. (II). An attribute of a node (non-terminal) that depends on the value of attributes of siblings and parent node in the parse tree is called synthesized attribute.

Detailed explanation-2: -An inherited attribute is one that is inherited from a parent product class. You customize an inherited attribute domain by editing its definition at the subclass level. When you edit an inherited attribute definition, the changes propagate to all members of the subclass, including other subclasses under that subclass.

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: -The inheritance attribute of a class indicates whether processes in the class should be automatically reclassified when one of the classification attributes of the process changes.

Detailed explanation-5: -In contrast to synthesized attributes, inherited attributes can take values from parent and/or siblings. As in the following production, S → ABC.

There is 1 question to complete.