
Correct : a,b
Option A - SDD2 is S-attributed with only synthesized attributes: TRUE
In SDD2, every attribute (D.type, T.type) is computed from the children and flows upward. There are no inherited attributes. This makes SDD2 a classic S-attributed SDD.
Option B - The languages P and Q are the same: TRUE
SDD1 uses a right-recursive grammar (D β TV, V β V1 id | id) and SDD2 uses a left-recursive grammar (D β D1 id | T id). Both describe declarations of the form "type id1, id2, ..." - the same language, just with different parse tree structures.
Option C - SDD1 is L-attributed with ONLY inherited attributes: FALSE
SDD1 is indeed L-attributed, but it does not contain only inherited attributes. T.type and D.type are synthesized attributes. Only V.type is inherited (it receives T.type from the parent). So the claim of "only inherited" is incorrect.
Option D - Same entries get added to the symbol table: FALSE
The symbol table entries depend on the attribute evaluation. Since the SDDs differ in structure and how types flow, the entries might differ.
Similar Questions
Total Unique Visitors