X -> zZ|yW|WW
Y->Z
Z->X|ε
W->Y|X
Would I be right to think that as Y only Z as its terminal the ε moves to Y giving:
X -> zZ|yW|WW
Y->Z|ε
Z->X
W->Y|X
then?
X -> zZ|yW|WW|z
Y->Z
Z->X
W->Y|X
X -> zZ|yW|WW
Y->Z
Z->X|ε
W->Y|X
Would I be right to think that as Y only Z as its terminal the ε moves to Y giving:
X -> zZ|yW|WW
Y->Z|ε
Z->X
W->Y|X
then?
X -> zZ|yW|WW|z
Y->Z
Z->X
W->Y|X
You missed the propagation of ε from Y in the w production.
which then moves up:
and continues:
and we are back we are we started! This grammar can never be written without ε.
(Unless someone wants to correct me?)