GATEverse Practice, past papers & mock tests
GATE 2024 · CS1 - Forenoon
Compiler DesignParsing TechniqueshardMCQ2 marks

Consider the following syntax-directed definition (SDD).

GRAMMAR RULES
SDHTU { S.val = D.val + H.val + T.val + U.val; }
D"M"D1 { D.val = 5 + D1.val; }
Dε { D.val = -5; }
H"L"H1 { H.val = 5*10 + H1.val; }
Hε { H.val = -10; }
T"C"T1 { T.val = 5*100 + T1.val; }
Tε { T.val = -5; }
U"K" { U.val = 5; } Given "MMLK" as the input, which one of the following options is the CORRECT value computed by the SDD (in the attribute S.val)?
Save your progress

Related Compiler Design PYQs