Flex/Lex和Yacc/Bison有什么区别? [英] What is the difference between Flex/Lex and Yacc/Bison?

查看:498
本文介绍了Flex/Lex和Yacc/Bison有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Flex& amp;和amp有什么区别? Lex和Yacc&野牛我疯狂地搜索了互联网,但没有找到可靠的答案.

What is the difference between Flex & Lex and Yacc & Bison. I searched the Internet wildly and I didn't find any solid answer.

我可以在Ubuntu上安装纯Lex和Yacc,还是只能安装flex和bison.我很困惑.

Can I install pure Lex and Yacc on Ubuntu, or I can install only flex and bison. I am confused.

  • Lex或Yacc是否仍由某人维护?
  • 所有人都免费吗?
  • 如果Lex不是免费的,为什么要在Ubuntu发行版中安装它?

  • 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

推荐答案

Lex和Flex之间有些区别,但是您必须滥用Lex才能遇到Flex问题. (我有一个滥用Lex的程序,因此在Flex下不起作用.)在Lex中,您可以提供自己的输入代码并修改字符流; Flex不允许您这样做.

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和Bison非常兼容,尽管Bison可以做一些额外的技巧.

Yacc and Bison are pretty closely compatible, though Bison has some extra tricks it can do.

您可能找不到要在Ubuntu上安装的Lex和Yacc的合法副本(原始的AT& T版本).我不一定会说这是不可能的,但我并不了解. Flex和Bison随时可用,在大多数情况下都是等效的.您可能还会从BSD世界中找到各种替代的和近似等效的程序.

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和Yacc由Unix SVRx许可证维护-IBM(AIX),HP(HP-UX)和Sun(Solaris)等公司已在其命令下修改了Lex和Yacc的版本. MKS还提供MKS Lex和MKS Yacc;但是,Yacc至少具有一些非标准扩展名.

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和Bison免费. (AT& T)Lex和Yacc不在.

Flex and Bison are free. (AT&T) Lex and Yacc are not.

这篇关于Flex/Lex和Yacc/Bison有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆