COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A synthesized attribute is an attribute whose value at a parse tree node depends on
A
Attributes at the Siblings only
B
Attributes at parent node
C
Attributes at children’s node only
D
None of the above
Explanation: 

Detailed explanation-1: -Explanation: Synthesized attribute’s value depend on children node only. Explanation: Bottom-up parsing identifies and processes the text’s lowest-level, before its mid-level structures, and the highest-level overall structure to last are left.

Detailed explanation-2: -1 Answer. Explanation: Synthesized attribute’s value depend on children node only.

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.

Detailed explanation-4: -A parse tree showing the values of attributes at each node is called annotated parse tree. Explanation: The process of computing the attribute values at the nodes is called annotating or decorating the parse tree.

Detailed explanation-5: -Note that the production must have A as its head. A synthesized attribute at node N is defined only in terms of attribute values at the children of N and at N itself. 2. An inherited attribute for a nonterminal B at a parse-tree node N is defined by a semantic rule associated with the production at the parent of N.

There is 1 question to complete.