在Mac上安装flex(词法分析器)
有人可以告诉我如何在我的 Mac 上安装 flex(词法分析器)吗?我在谷歌上到处搜索但找不到它。我有通用二进制文件,并将其提取到桌面,但我不知道从这里去哪里。任何帮助将不胜感激!
Can someone tell me how I can install flex (lexical analyzer) on my Mac? I searched everywhere on google and I can't find it. I have the universal binary and I extracted it to my desktop but I have no idea where to go from here. Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尝试使用 Homebrew(Mac 数据包管理器)并使用以下命令:-
Try using Homebrew (Packet manager for Mac) and use the following command :-
您可以使用 macports 安装 flex
You can use macports to install flex
Flex 随 xCode 命令行工具一起提供;你只需通过 xcode > 安装它们偏好>下载>>命令行工具。这还包括 gcc (Clang)。
Flex is shipped with the xCode Command line tools; you only got to install them via xcode > preferences > downloads > Command line tools. This also includes gcc (Clang).
您始终可以从源代码安装。从 Flex 站点 下载 tarball,解压,cd 到解压目录,然后运行假设
你的 Mac 上有 make 和 C 编译器,我相信所有的 Mac 都有。
You can always install from source. Download the tarball from the flex site, extract it, cd to the directory where you extracted it, and run the following:
Assuming you have make and a C compiler on your Mac, which I believe all Macs have.
此信息可以帮助某人节省时间:
就在今天,我尝试从源安装 FLEX 2.5.39。
制作 - 失败。
经过一番思考,我决定尝试较旧的档案。
2.5.38 - 失败
2.5.37 - OK
看起来在 now() = 2015-03-15,macport 也使用 2.5.37 版本。
This info can help to somebody to save time:
Just today I have try to install FLEX 2.5.39 from sources.
Make - fails.
After some thoughts I have decide to try older archives.
2.5.38 - fail
2.5.37 - OK
It seems on now() = 2015-03-15, macport also uses 2.5.37 build.