Convert finite state machine to regular expression

后端 未结 5 618
面向向阳花
面向向阳花 2021-01-31 22:14

Is there a tool (or an algorithm) to convert a finite state machine into a regular expression?

(not the other way around, that would be easy).

5条回答
  •  时光说笑
    2021-01-31 22:58

    You don't specify what you're doing, but you might want to know there is a tool called Ragel that specializes in FSMs. It generates code for a slew of languages, and when I looked a few years ago, it wasn't too hard to port the machines to other languages.

提交回复
热议问题