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

前端 未结 7 768
孤街浪徒
孤街浪徒 2021-02-14 03:15

The version of GNU Bison on my mac is 2.3 but I know that Bison 2.5 was released long ago. The book Flex & Bison uses version 2.5.

Should I upgrade to 2.5 m

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-14 04:12

    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.
    

提交回复
热议问题