0

I need to construct a CFG for the language which can generate any phrase containing all symbols.

S -> ABC
A -> a,b,c,d.........z | B
B -> .,?,-,=,.... | C
C -> A | epsilon 

I think it's not right. is there anyway to make it work so it can generate any phrase?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

i just figured it with my friend. here is the answer

S -> ABC | A | B
A -> aS,bS,cS,dS.........zS | B
B -> .S,?S,-S,=,.... | C
C -> A | epsilon