COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In a bottom up evaluation of a syntax direction definition, inherited attributes can ____
A
Always be evaluated
B
Be evaluated only if the definition is L-attributed
C
Evaluation only done if the definition has synthesized attributes
D
None of these
Explanation: 

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.

There is 1 question to complete.