It’s not possible to create a BNF grammar for a sequence of characters (possibly empty) separated by a comma, but not start or end with a comma,
So this is normal:
<--- Empty sequence is ok!
A
A,B
A,B,C
It is not normal:
A,
,A
A,,B
AB
An empty box throws me away. So far I have received:
<char-seq> ::= <empty> | <char> , <char-seq> | <char>
but this creates strings like A,: - (
source
share