Question: (d) Consider the following grammar for generating function prototypes in a Java-like language. The alphabet for this language contains the following terminals (words and symbols):

(d) Consider the following grammar for generating function prototypes in a Java-like language. The alphabet for this language contains the following terminals (words and symbols): [={public, private, static void, int, float, double, main, compute, x, y, z, (,)... :}. Start = AccMod Type FunName AccMod Type FunName(ArgList); public AccMod private AccMod | AccMod static | 8 void | int | float | double main | compute x ly lz Arg | ArgList, Arg Type ArgName ArgName ArgList := Arg Show that this grammar is ambiguous by drawing two derivation trees for the fol- lowing prototype: public static double compute(float y, double z); Note: All of the variables (non-terminals) are shown in bold in the above grammar [5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
