SEMANTIC ANALYSIS
ATTRIBUTE GRAMMARS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
synthesized attribute
|
|
inherited attribute
|
|
canonical attribute
|
|
None of the above
|
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.
Detailed explanation-2: -The syntax directed translation scheme is used to evaluate the order of semantic rules. In translation scheme, the semantic rules are embedded within the right side of the productions. The position at which an action is to be executed is shown by enclosed between braces.
Detailed explanation-3: -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.