Le the two productions be P → CD and P → AB. Consider the following rules.
Rule 1: P.i = C.i + D.i and C.i = D.i - 1
Rule 2: A.i = P.i * 2 and B.i = A.i + P.i
Each of the five non-terminals P, A, B, C, and D has two attributes: s is a synthesized attribute, and i is an inherited attribute.
Which one of the following is true?1
Only Rule 1 is L-attributed.
2
Only Rule 2 is L-attributed.
3
Both Rule 1 and Rule 2 are L-attributed.
4
Neither Rule 1 nor Rule 2 is L-attributed.