Question 1 8 7 15 Marks Following Grammar Suitable Top Predictive Parser Identify Problem Q43782643
Question#1 [8+7=15 Marks] a) The following grammar is not suitable for a top-down predictive parser. Identify the problem and correct it by rewriting the grammar. Show that your new grammar satisfies the LL(1) condition. R → L → Ra Qba aba caba Q bbc bo Rbc b) Consider the following grammar: A → Ba B + dab ТСЬ с – I с В Ac Does this grammar satisfy the LL(1) condition? Justify your answer. If it does not, rewrite it as an LL(1) grammar for the same language. Show transcribed image text Question#1 [8+7=15 Marks] a) The following grammar is not suitable for a top-down predictive parser. Identify the problem and correct it by rewriting the grammar. Show that your new grammar satisfies the LL(1) condition. R → L → Ra Qba aba caba Q bbc bo Rbc b) Consider the following grammar: A → Ba B + dab ТСЬ с – I с В Ac Does this grammar satisfy the LL(1) condition? Justify your answer. If it does not, rewrite it as an LL(1) grammar for the same language.
Expert Answer
Answer to Question#1 [8+7=15 Marks] a) The following grammar is not suitable for a top-down predictive parser. Identify the proble…
OR