GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2020

GATE 2020 · CS · MCQ · 2 marks · Compiler Design › Semantic Analysis

GATE 2020 Computer Science and Information Technology question: Consider the productions A PQ and A XY. Each of the five non-terminals A, P, Q, X, and Y…

Consider the productions and . Each of the five non-terminals , , , , and has two attributes: is a synthesized attribute, and is an inherited attribute. Consider the following rules.

Rule 1: , , and

Rule 2: and

Which one of the following is TRUE?

  1. (A)

    Both Rule 1 and Rule 2 are L-attributed.

  2. (B)

    Only Rule 1 is L-attributed.

  3. (C)

    Only Rule 2 is L-attributed.

  4. (D)

    Neither Rule 1 nor Rule 2 is L-attributed.

Show answer

Official answer: B

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion