SYNTAX ANALYSIS
ROLE OF THE PARSER
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: -The correct option is C be evaluated only if the definition has synthesized attributes. Every S(Synthesized). attributed definition is L-attributed . For implementing inherited attributed during bottom-up parsing, extends to some, but not LR grammars.
Detailed explanation-2: -S-attributed SDD. A syntax-directed definition (SDD) that involves only synthesized attributes is called S-attributed SDD. In an S-attributed SDD, each rule computes. an attribute for the nonterminal at the head of a production from attributes taken from the body of the production.
Detailed explanation-3: -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.