116k views
2 votes
Design a context-free grammar to generate strings having an arbitrary number (at least 0) of copies of any of the above forms in any combination. For the remaining problems, your generated strings are allowed (but not required) to have leading zeroes.

1 Answer

5 votes

Answer:

G = (V, Σ, R, S) with set of variables V = {S, X}, where S is the

start variable; set of terminals Σ = {a, b, c}; and rules

S → aSc | X

X → bXc | ε

User Ramesh Kotkar
by
6.0k points