Consider the productions \(A → PQ\) and \(A → XY\). Each of the five…

GATE · 2020 · CS · Computer Science & IT

Consider the productions A→PQA → PQ and A→XYA → XY. Each of the five non-terminals A,P,Q,XA,P,Q,X, and YY has two attributes: ss is a synthesized attribute, and ii is an inherited attribute. Consider the following rules.

Rule 1 : P.i=A.i+2, Q.i=P.i+A.i, P . i = A.i + 2, \: Q.i = P. i + A.i, and A.s=P.s+Q.sA.s = P.s +Q. s

Rule 2 : X.i=A.i+Y.s X.i = A.i + Y.s, and Y.i=X.s+A.iY. i = X. s +A .i

Which one of the following is TRUE ?

  1. A.

    Both Rule 1 and Rule 2 are L−attributedL - attributed

  2. B.

    Only Rule 1 is L−attributedL - attributed

  3. C.

    Only Rule 2 is L−attributedL - attributed

  4. D.

    Neither Rule 1 nor Rule 2 is L−attributedL - attributed

Attempted by 157 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…