First of all,
put() matlab kuch nahi hai bas table mai entries enter karo so don't consider them now.
A - Grammar ko dekho sirf, Semantic rules ignore karo.
G1 generates
int a
float a
int a b
float a b
int a b c
float a b c
i.e. (type) (one or more identifiers)
G2 generates
D id
D id id
T id id id
int id id id / float id id id
i.e. again (type) (one or more identifiers)
Dono Same hi grammar generate kar rahe hai
So, Statement 1 is true
Now, Analyze SDD1
Grammar : D → TV
Rules : D.type = T.type ......child to parent, hence synthesized
V.type = T.type ......left sibling to right sibling, hence inherited
Bass, grammar aage check karne ki jarurat nahi hai,
Synthesized + Inherited = L - attributed
But, C - hame bata raha hai ki SDD1 is only inherited attributes, hence WRONG
Abb, Let's Analyze SDD2
jab dyan se dekhoge toh bata chalega,
every production is child to parent, Hence only Synthesized = S - attributed.
Hence, B - SSD2 is S-attributed and contains only synthesized attributes is Right
Abb, sirf symbol table mai entries check karni hai
SDD2 mai put(id.entry, T.type) ......and T.type can be int/float
Similarly,
SDD1 mai put(id.entry, V.type) ......and upar hi likha hai,
V.type=T.type and again T.type can be int/float
Hence, both gets/stores same entries in symbol table
Statement 4 is also Right.