I need to generate unambiguous grammar to access the language L= { a^i b^j c^k | i, j, k ≥ 0 , i = j or i = k }
What I already have is:
S : X | Y
X : TC
T : aTb | ԑ
C : cC | ԑ
Y : aYc | F
F : bF | ԑ
but this grammar is ambiguous, it can recognize the strings with equal number of a,b,c in two different ways. Is there any better suggestion to make it unambiguous?