I recently had a question asked about BNF definitions for a Programming
Languages Course. The question is as follows:
Using character set C={a,b} write a BNF definition for the language
consisting of all strings with odd length whose first and middle characters are
the same.
If anyone can help it would be greatly appreciated.
e-mail: ·····@iowasp.physics.uiowa.edu
·····@iowasp.physics.uiowa.edu writes:
> Using character set C={a,b} write a BNF definition for the language
>consisting of all strings with odd length whose first and middle characters are
>the same.
Trying the policy that the nastiest thing you can do in response to a
homework question is give an answer without explanation, here it is:
matched --> [a], nested_a, x.
matched --> [b], nested_b, x.
nested_a --> [a].
nested_a --> x, nested_a, x.
nested_b --> [b].
nested_b --> x, nested_b, x.
x --> [a].
x --> [b].
--
The party that took Australia into Vietnam wants to smash the inner-city
yacht school and put a Grand Prix in its place. They don't change.