Write a recursive program to generate random sentences from a given BNF grammar. A BNF grammar is a recursively defined file that defines rules for creating sentences from tokens of text. Rules can be recursively self-similar. The following grammar can generate sentences such as “Fred honored the green wonderful child”:
::=::= | ::=the | a ::= | ::=big|fat|green|wonderful|faulty|subliminal|pretentious ::=dog|cat|man|university|father|mother|child|television ::=John|Jane|Sally|Spot|Fred|Elmo ::= | ::=hit|honored|kissed|helped ::=died|collapsed|laughed|wept
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.