且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Flex/Lex和Yacc/Bison有什么区别?

更新时间:2022-01-20 01:02:17

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.