From: ·····@iowasp.physics.uiowa.edu
Subject: BNF DEFINITION - help
Date: 
Message-ID: <1994Sep5.221314@iowasp.physics.uiowa.edu>
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
From: Richard A. O'Keefe
Subject: Re: BNF DEFINITION - help
Date: 
Message-ID: <34k19f$64o@goanna.cs.rmit.oz.au>
·····@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.