I am struggling to construct a good CFG for a L={xE{0,1}* |
that is of even length and have a maximum of two 0s}
So words like L={11, 10, 0011...}
I am trying with the following attempt.
S -> E | E0A | A0E | E0E0E | 00EA | EA00
E-> 1A | e
A -> 1E
I am running different derivations and they seem to make sense, but I am still unsure if my grammar is correct, or is there is a better way to improve it? Thank you very much, I have been struggling with CFG and I am trying to practice more to help me understand.