GATEverse
← GATE CSE 2004

Q45

MCQ2 marks, −0.5

Consider the grammar with the following translation rules and EE as the start symbol

E→E1# T{E.value=E1.value∗T.value}∣T{E.value=T.value}T→T1& F{T.value=T1.value+F.value}∣F{T.value=F.value}F→num{F.value=num.value}\begin{array}{lll} E \rightarrow E_ 1\# \: T & \qquad\left\{E.value = E_1.value * T.value\right\}\\ \qquad\mid T & \qquad \{E.value = T.value\}\\ T \rightarrow T_1 \& \: F &\qquad \{T.value = T_1.value + F.value\}\\ \qquad\mid F&\qquad \{T.value = F.value\}\\ F \rightarrow \text{num}&\qquad \{F.value=num.value\} \end{array}

Compute E.valueE.value for the root of the parse tree for the expression:22 # 33 & 55 # 66 & 44

Sign in to save attempts.

Loading…