Reputation: 185
I am trying to find a regular grammar that generates the language given by the regular expression ((a+b∗c)d)∗
. Is there a general technique I can use to convert regular expressions into regular grammars?
Upvotes: 0
Views: 335
Reputation: 373082
It's usually a lot easier to convert a finite automaton for a regular language into a regular grammar than it is to convert a regular expression into a regular grammar. I'd recommend starting off by building an automaton for the regular expression - either manually or by applying Thompson's algorithm to mechanically convert the regex to an automaton - and then doing the conversion from there.
Upvotes: 1