GATEverse
← GATE CSE 2005

Q83a

MCQMarks unknown

Statement for Linked Answer Questions 83a & 83b: Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar production.

E→numberE.val=number.val∣ E  ‘+’ EE(1).val=E(2).val+E(3).val∣ E  ‘×’ EE(1).val=E(2).val×E(3).val\begin{array}{l|l} E\rightarrow number & E.val = {number.val} \\\qquad \mid \ E \ \ ‘+\text{'} \ E & E^{(1)}.val = E^{(2)}.val + E^{(3)}.val \\\qquad \mid \ E \ \ ‘\times\text{'} \ E & E^{(1)}.val = E^{(2)}.val \times E^{(3)}.val \end{array}

The above grammar and the semantic rules are fed to a yaac tool (which is an LALR(1) parser generator) for parsing and evaluating arithmetic expressions. Which one of the following is true about the action of yaac for the given grammar?

Sign in to save attempts.

Loading…