I want to develop my own C compiler to get deeper into flex and bison for my compiler lessons at University, but I can't find flex and bison, which I've seen described in some other posts. Do I need to install extra packages for Xcode or is there any other way?
我想开发我自己的C编译器,以便在flex和bison中更深入地了解我在大学的编译器课程,但是我找不到flex和bison,我在其他一些帖子中看到过。我需要为Xcode安装额外的包吗?或者有其他的方式吗?
I'm running Mac OS X Lion and have Xcode 4.3.2.
我正在运行Mac OS X Lion,并有Xcode 4.3.2。
2 个解决方案
#1
9
Flex and bison are also included with the optional Command-Line Tools download for Xcode 4.3. See instructions at https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html on how to install this. They end up installed in /usr/bin.
Flex和bison也包含在Xcode 4.3的可选命令行工具中。参见https://developer.apple.com/library/ios/#文档/DeveloperTools/概念性/WhatsNewXcode/ xcode _4_ .html如何安装。最后安装在/usr/bin中。
You may prefer getting them via port as *foe suggested, since this gets you newer versions.
您可能更喜欢通过端口来获得它们,就像*foe建议的那样,因为这样可以获得较新的版本。
#2
4
Install macports and do:
安装macports和做的事:
$ sudo port install flex bison
However you might need to
rig-up the
/Developer
directory using a symbolic link first:
不过,您可能需要首先使用符号链接来对/Developer目录进行严格的处理:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
(There is no longer any need to rig-up anything).
(再也不需要对任何事情进行严格的处理)。
#1
9
Flex and bison are also included with the optional Command-Line Tools download for Xcode 4.3. See instructions at https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html on how to install this. They end up installed in /usr/bin.
Flex和bison也包含在Xcode 4.3的可选命令行工具中。参见https://developer.apple.com/library/ios/#文档/DeveloperTools/概念性/WhatsNewXcode/ xcode _4_ .html如何安装。最后安装在/usr/bin中。
You may prefer getting them via port as *foe suggested, since this gets you newer versions.
您可能更喜欢通过端口来获得它们,就像*foe建议的那样,因为这样可以获得较新的版本。
#2
4
Install macports and do:
安装macports和做的事:
$ sudo port install flex bison
However you might need to
rig-up the
/Developer
directory using a symbolic link first:
不过,您可能需要首先使用符号链接来对/Developer目录进行严格的处理:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
(There is no longer any need to rig-up anything).
(再也不需要对任何事情进行严格的处理)。