While removing null production from cfg as below,
S->ABC A->aA|^ B->bB|^ C->aaC|^
now as shown above we know that A,B and C all are nullable that makes S also nullable. like I'd do as below:
S->ABC|AB|AC|BC|A|B|C|^ A->aA|a B->bB|b C->aaC|aa
The question is how do I remove null from S? I tried searching but I everything getting mixed up....
Like one solution was defining new rule. I can't find the link now but it told to do something like below We have only one null production left...
to remove null from the method was
but the problem is S now become nullable production and there in still null production in the grammar i-e T->^
Another solution was to make new rule (as below) such that at least starting symbol is not null production but from my understanding its still nullable... There still exists a null in the grammar.
Thankyou in Advance