Why does my Mac (OS X 10.7.3) have an old version (2.3) of Gnu Bison?

I had the same issue MacOSX 10.9.5.

After doing:

brew install bison

I added this to my bash profile:

export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH

(by the time you read this, your version may be different from 3.0.4) And after I restarted the Terminal it picked up the new version of Bison when I did bison -V


If you are using zsh:

$ brew unlink bison
$ echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.zshrc
$ export LDFLAGS="-L/usr/local/opt/bison/lib"
$ source ~/.zshrc
$ bison -V
bison (GNU Bison) 3.4.1
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Tags:

Macos

Gnu

Bison