Question: Assignment For the following BNF grammar rules, answer the questions that follow. - (5 pts) is this grammar ambiguous? (Yes/ No) - (10 pts) If
Assignment For the following BNF grammar rules, answer the questions that follow. - (5 pts) is this grammar ambiguous? (Yes/ No) - (10 pts) If this grammar is ambiguous, re-write the rules to remove the ambiguity such that: - You do not add any new grammar rules - You only change 1 nonterminal within 1 grammar rule. - Any previously valid sentence continues to be valid. If the grammar is not ambiguous, re-write the rules as is from above with no changes. - (15 pts) Using your grammar from Question 12 , derive the following sentence. You must show each sentential form/step for the derivation. If the sentence cannot be derived, stop at the last step that you could derive and write "Cannot Continue Derivation". Sentence: a= const ; b=a;c=a+ const / const ; - (15 pts) Using your grammar from Question #2, derive the following sentence, You must show each sentential form / step for the derivation. If the sentence cannot be derived, stop at the last step that you could derive and write "Cannot Continue Derivation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
