Topics in Syntax Directed Translation

Filter by year

Syntax Directed Translation questions

Q22

GATE CS 2025 CS-2Syntax Directed TranslationMCQ1 mark−1/3 if wrong
Given the following syntax directed translation rules:

Rule 1: R→AB{B.i=R.i−1;A.i=B.i;R.i=A.i+1;}R \rightarrow AB \{B.i = R.i - 1; A.i = B.i; R.i = A.i + 1;\}
Rule 2: P→CD{P.i=C.i+D.i;D.i=C.i+2;}P \rightarrow CD \{P.i = C.i + D.i; D.i = C.i + 2;\}
Rule 3: Q→EF{Q.i=E.i+F.i;}Q \rightarrow EF \{Q.i = E.i + F.i;\}

Which ONE is the CORRECT option among the following?
Show answer without attempting

Answer: C

0/10 correct0 marks

Related topics in Compiler Design