user3419487
user3419487

Reputation: 185

Finding a regular grammar for a given regular expression?

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

Answers (1)

templatetypedef
templatetypedef

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

Related Questions