COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In synthesize attribute, we can evaluate in ____ order.
A
Bottom-up
B
Top-down
C
Preorder
D
Postorder
Explanation: 

Detailed explanation-1: -Synthesized attribute can be evaluated during a single bottom-up traversal of parse tree. While on other hand Inherited attribute can be evaluated during a single top-down and sideways traversal of parse tree. Both terminal and Non terminals can contain the Synthesized attribute.

Detailed explanation-2: -BOTTOM UP EVALUATION OF S ATTRIBUTED DEFINITION Bottom Up Evaluation of S Attributed An attribute grammar is a formal way to define attributes for the productions of a formal grammar, associating these attributes to values.

Detailed explanation-3: -S-attributed SDT As depicted above, attributes in S-attributed SDTs are evaluated in bottom-up parsing, as the values of the parent nodes depend upon the values of the child nodes.

Detailed explanation-4: -2. In a bottom-up evaluation of a SDT, inherited attribute can evaluated only if definition in L-attributed.

Detailed explanation-5: -7. If an SDT uses only synthesized attributes, it is called as? Explanation: If an SDT uses only synthesized attributes, it is called as S-attributed SDT. 8.

There is 1 question to complete.