- 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 47 times
07: (a) State why the following BNF grammar for palindromes (words that are the same in reverse e.g., "noon" or "radar")
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
07: (a) State why the following BNF grammar for palindromes (words that are the same in reverse e.g., "noon" or "radar")
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)