user1889966
user1889966

Reputation: 165

Removing epsilon production from context-free grammar

I am just having trouble with one part of the grammar that reads:

C -> CBA | epsilon

After I remove epsilon productions, I get:

C -> CBA | CB | BA | B | A

I'm confused as to whether this is correct or not. In the grammar, B is also a nullable variable. Do I also have to include CA and/or A in the latter grammar?

Any help appreciated.

Upvotes: 0

Views: 2198

Answers (0)

Related Questions