07: (a) State why the following BNF grammar for palindromes (words that are the same in reverse e.g., "noon" or "radar")
Posted: Fri May 20, 2022 12:04 pm
07: (a) State why the following BNF grammar for palindromes (words that are the same in reverse e.g., "noon" or "radar") is incorrect. Show how it can be fixed by rewriting the BNF rules. Point out the drawbacks of this approach. (5 marks) <palindrome> > cletter> <palindrome) cletter | cletter | (letter> -> abl... I z AB ... Iz | Z (b) Solve the problem in part (a) by adding attribute(s). semantic rule(s) and predicate(s) as necessary, instead of rewriting the BNF rules. (5 marks)