Question: Question 2: Can the following strings be generated by drawing parse tree for each using the given CFG: S aSB S aB S B B
Question 2: Can the following strings be generated by drawing parse tree for each using the given CFG:
S aSB S aB S B B b
Strings are: w1=abb w2=abab w3=aabb w4=abba w5=aaaabbb
Question 3: Using the string b = a * b * c b + a + d prove that the given grammar is ambiguous by the following string derivation methods: a). Parse Tree b). RMD
While the grammar is: E E * F | E + E |F F F F | F = G | G G a | b | c | d
Question 4: i). Write the precedence and associativity of operators shown in grammar in
Question-3. ii). Why the grammar is ambiguous?
Question 5: i). Convert the grammar in Question-3 into unambiguous. ii). Parse the same string using the unambiguous grammar.
*********************************************
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
