COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Always be evaluated
|
|
Be evaluated only if the definition is L-attributed
|
|
Evaluation only done if the definition has synthesized attributes
|
|
None of these
|
Detailed explanation-1: -In a bottom-up evaluation of a SDT, inherited attribute can evaluated only if definition in L-attributed.
Detailed explanation-2: -In a bottom-up evaluation of a syntax directed definition, inherited attributes can. always be evaluated. be evaluated only if the definition is L-attributed.
Detailed explanation-3: -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-4: -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.
Detailed explanation-5: -If an SDT uses only synthesized attributes, it is called as S-attributed SDT.