Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex and Bison on Mac OS X Lion with Xcode 4.3.2

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?

I'm running Mac OS X Lion and have Xcode 4.3.2.

like image 556
Pascal Bayer Avatar asked Apr 29 '12 09:04

Pascal Bayer


2 Answers

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.

You may prefer getting them via port as trojanfoe suggested, since this gets you newer versions.

like image 124
Rich Drummond Avatar answered Oct 24 '22 05:10

Rich Drummond


Install macports and do:

$ sudo port install flex bison

However you might need to rig-up the /Developer directory using a symbolic link first:

$ sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer

(There is no longer any need to rig-up anything).

like image 4
trojanfoe Avatar answered Oct 24 '22 05:10

trojanfoe