Solution (source code)

= Solution

This language is not context-free. Intersect it with the regular language
$$
R=0^+1^+0^+.
$$
An even palindrome in $R$ has the form $0^r1^{2s}0^r$, and its first half is $w=0^r1^s$. The required equality of the numbers of zeros and ones in $w$ forces $r=s$. Hence the intersection is
$$
L\cap R=\{0^n1^{2n}0^n:n>0\}.
$$
This is not context-free: applying the pumping lemma to $0^p1^{2p}0^p$, a pumped substring of length at most $p$ cannot meet both zero blocks. Pumping therefore either destroys equality of the two zero counts or changes the middle count away from twice their common value.

Context-free languages are closed under intersection with regular languages, so a context-free $L$ would make $L\cap R$ context-free. This contradiction proves the claim.