The language is NOT context free language! your grammar is wrong!
According to language description 0
s at suffix should be less then number of 1
s and prefix 0
s. But using your grammar you can generate wrong string as follows:
Step1: Always replace S
by S0
Step2: Now replace S
to Y
S --> S0 --> S00 --> S000 --> Y000
Now you can replace Y
to ^
(nul) it gives 000
, this string is not in your language.
either replace Y
to 0Y1
then Y
to ^
:
Y000 ---> 0Y1000 ---> 01000
01000
string is not in language. So your grammar does not generate the same language.