I write a little grammar as an exercise for the class, and my professor did not understand too much what qualifies the legal expression of BNF in terms.
The BNF grammar is supposed to recognize strings in this form: AB, AABB, AAABBB, A ... B ... (general form: AnBn)
So, what I came to, wrote:
<S> --> A<S>B | ""
My simple yes / no question is, is this legal in the BNF, and if not why?
<...> is nonterminal, I have no idea if this is an agreement or what not
source
share