Computer Sciences > Gate 2020 > SDT
Consider the productions A → PQ and A → XY. Each of the five non-terminals A,P,Q,X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.

Rule 1: P.i=A.i+2, Q.i=P.i+A.i, and A.s=P.s+Q.s
Rule 2: X.i=A.i+Y.s and Y.i=X.s+A.i

Which one of the following is TRUE ?
A
Both Rule 1 and Rule 2 are L-attributed
B
Only Rule 1 is L-attributed
C
Only Rule 2 is L-attributed
D
Neither Rule 1 nor Rule 2 is L-attributed

Correct : b

Similar Questions

Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b}. S −→ aA { print 1 } S −→ a { print 2 } A...
#115 MCQ
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......