Page 1 of 1

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
by answerhappygod
07 A State Why The Following Bnf Grammar For Palindromes Words That Are The Same In Reverse E G Noon Or Radar 1
07 A State Why The Following Bnf Grammar For Palindromes Words That Are The Same In Reverse E G Noon Or Radar 1 (76.7 KiB) Viewed 49 times
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)