In a recent test, I was asked to recognize if the below language is context free:
$\qquad\displaystyle L = \{0^{n+m}1^{n+m}0^m \mid n,m \geq 0\}$
I think it is context free, and can be accepted by below context free grammar, where $S$ is the start symbol and $Y$ is a non-terminal:
$\qquad S \to S0 \mid Y$
$\qquad Y \to 0Y1 \mid \epsilon$
However, my answer was considered wrong and that the language $L$ is not context free.
I'm confident about my answer, but the response has got me confused. Is my understanding correct? Please let me know if I've missed something.
0100
is not in L and generated byS->S0->S00->Y00->0Y100->0100
). $\endgroup$