Flex/Lex 和 Yacc/Bison 有什么区别?
Flex 和 Flex 之间有什么区别? Lex 和 Yacc & 野牛。 我在网上疯狂搜索,没有找到任何可靠的答案。
我可以在 Ubuntu 上安装纯 Lex 和 Yacc,还是可以只安装 flex 和 bison。 我很困惑。
- Lex 或 Yacc 是否仍然由某人维护?
- 它们都是免费的吗?
如果 Lex 不是免费的,为什么我要把它安装在我的 Ubuntu 发行版上?
<前><代码>lex --版本 35 年 5 月 2 日
What is the difference between Flex & Lex and Yacc & Bison. I searched the Internet wildly and I didn't find any solid answer.
Can I install pure Lex and Yacc on Ubuntu, or I can install only flex and bison. I am confused.
- Is Lex or Yacc still being maintained by someone?
- Are all of them free?
If Lex is not free why do I have it installed on my Ubuntu distribution?
lex --version lex 2.5.35
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Lex 和 Flex 之间存在一些差异,但您必须滥用 Lex 才会遇到 Flex 的问题。 (我有一个滥用 Lex 的程序,因此无法在 Flex 下工作。)这主要是在输入前瞻领域; 在Lex中,您可以提供自己的输入代码并修改字符流; Flex 不会让你这么做。
Yacc 和 Bison 非常兼容,尽管 Bison 有一些额外的技巧。
您可能无法找到要在 Ubuntu 上安装的 Lex 和 Yacc(原始 AT&T 版本)的合法副本。 我不一定说这是不可能的,但我不知道这一点。 Flex 和 Bison 很容易获得,并且对于大多数用途来说是等效的。 您还可以在 BSD 世界中找到各种替代且大致等效的程序。
Lex 和 Yacc 由 Unix SVRx 许可证持有者维护 - IBM (AIX)、HP (HP-UX) 和 Sun (Solaris) 等公司已按照其命令修改了 Lex 和 Yacc 的版本。 MKS还提供MKS Lex和MKS Yacc; 然而,Yacc 至少有一些非标准扩展。
Flex 和 Bison 是免费的。 (AT&T) Lex 和 Yacc 不是。
There are some differences between Lex and Flex, but you have to be abusing Lex to run into the problems with Flex. (I have a program which abuses Lex and doesn't work under Flex, therefore.) This is primarily in the area of input lookahead; in Lex, you can provide your own input code and modify the character stream; Flex won't let you do that.
Yacc and Bison are pretty closely compatible, though Bison has some extra tricks it can do.
You probably can't find legitimate copies of (the original, AT&T versions of) Lex and Yacc to install on Ubuntu. I wouldn't necessarily say it is impossible, but I'm not aware of such. Flex and Bison are readily available and are equivalent for most purposes. You may also find various alternative and approximately equivalent programs from the BSD world.
Lex and Yacc are maintained by the Unix SVRx licencees - companies such as IBM (AIX), HP (HP-UX) and Sun (Solaris) have modified versions of Lex and Yacc at their command. MKS also provides MKS Lex and MKS Yacc; however, the Yacc at least has some non-standard extensions.
Flex and Bison are free. (AT&T) Lex and Yacc are not.
Bison 是 Yacc 的 GNU 实现/扩展,Flex 是 Lex 的继承者。 无论哪种情况,都可以(并且推荐)使用 bison / flex。
Bison is the GNU implementation/extension of Yacc, Flex is the successor of Lex. In either case, it's fine (and recommended) to use bison / flex.
在大多数(全部?)Linux 系统上,“Lex”实际上是指向 flex 的符号链接。 基本上,它只是与免费版本的名称不同。
On most (all?) Linux systems, "Lex" is actually a symbolic link to flex. Basically, it's only a different name to the free version.
YACC 可根据 Plan 9 和 Open Solaris 的开源许可证使用。 另外,还有 Berkeley YACC,它与原始 YACC 兼容,但不共享源代码。 Berkeley YACC 可以在任何开源 BSD 操作系统上找到。
YACC is available under open source licenses from both Plan 9 and Open Solaris. Also, there is also Berkeley YACC, which is compatible with the original YACC, but does not share source code. Berkeley YACC can be found on any of the open source BSD operating systems.
Bison 是 GNU 项目的一部分。 yacc 在 Berkeley Software Distribution (BSD) 上用作实用程序。虽然它与 yacc 兼容,但 Lex 和 Yacc 已成为过去。 Flex 和 bison 如今被广泛使用。
Bison in a part of the GNU project. And yacc is used as a utility on Berkeley Software Distribution (BSD).Though its compatible with yacc, but Lex and Yacc are a thing of the past. Flex and bison are widely used today.