DFA-> 正则表达式

发布于 2024-07-10 21:48:33 字数 57 浏览 4 评论 0原文

我在纸上写了一个 DFA,并想将其转换为一组正则表达式。 有人知道有一个好的工具可以做到这一点吗?

I've written a DFA on paper, and want to translate it into a set of regular expressions. Does anybody know a good tool to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何其悲哀 2024-07-17 21:48:33

从我的谷歌搜索中,我找到了 JFLAP。 他们还有关于如何将 FA 转换为正则表达式的教程。

JFLAP

JFLAP是用于实验的软件
正式语言主题包括
不确定性有限自动机,
不确定性下推自动机,
多带图灵机,几个
语法类型、语法分析和
L-系统。 除了建造
以及这些的测试示例,JFLAP
允许人们尝试
施工证明从一种形式到
另一个,例如将 NFA 转换为
DFA 到最小状态 DFA 到
正则表达式或正则语法。
单击此处了解更多信息
JFLAP 可以做什么。

From my little google search, I found JFLAP. They also have a tutorial on how to Convert FA to regular expression.

JFLAP

JFLAP is software for experimenting
with formal languages topics including
nondeterministic finite automata,
nondeterministic pushdown automata,
multi-tape Turing machines, several
types of grammars, parsing, and
L-systems. In addition to constructing
and testing examples for these, JFLAP
allows one to experiment with
construction proofs from one form to
another, such as converting an NFA to
a DFA to a minimal state DFA to a
regular expression or regular grammar.
Click here for more information on
what one can do with JFLAP.

夜还是长夜 2024-07-17 21:48:33

如果您想要的是解析器,则无需将其转换为正则表达式作为中间形式。 您可以使用 flexre2c 相当直接地编写 DFA 代码。 多个状态的编码并不常见,所以一开始感觉有点不自然(并且教程中没有很好地介绍),但是一旦你开始使用它,它真的很容易。

If what you want is a parser, there's no need to translate into regular expressions as an intermediate form. You can code a DFA fairly straightforwardly using flex or re2c. The coding for multiple states is not the common case, so it feels slightly unnatural at first (and it's not well covered in tutorials), but once you get rolling with it, it's really easy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文