Berkeley Yacc


Berkeley Yacc is a Unix parser generator designed to be compatible with Yacc. It was originally written by Robert Corbett and released in 1989. Due to its liberal license and because it was faster than the AT&T Yacc, it quickly became the most popular version of Yacc. It has the advantages of being written in ANSI C89 and being public domain software.
It contains features not available in Yacc, such as reentrancy, which is implemented in a way that is broadly compatible with GNU Bison.

History

In 1985, Robert Corbett developed an original LALR parser generator based on a 1982 paper by DeRemer and Pennello. Corbett wrote it as part of his research towards the Ph.D. he received from University of California, Berkeley in June 1985. It was originally named Byson and was incompatible with Yacc but it was subsequently renamed Bison and became the basis of GNU Bison.
Later in 1985, Corbett derived another Yacc-compatible LALR parser generator originally named Zeus but subsequently renamed Zoo. Corbett published the source code for Zoo in a Usenet newsgroup but it went mostly unnoticed until later in September 1989 when Corbett posted on the comp.compilers newsgroup about putting the source code on an FTP server. There was discussion about renaming it and by October 1989 it had become known as Berkeley Yacc.
In 1995, Chris Dodd developed BtYacc, a backtracking derivative of Berkeley Yacc to support parsing context-sensitive languages like C++, based on a 1993 paper by Merrill describing similar modifications to AT&T Yacc. It offers backtracking and semantic disambiguation for parsing ambiguous grammar. A rule parsed but rejected by semantic information can be rolled back, so that the parser can try another rule. However, it has also been criticized for needing side-effect free trial actions and its inflexible handling of shift-reduce conflicts.
In 1997, Vadim Maslov took over maintenance of BtYacc to support a COBOL parser developed by his company. By 1999, the last 3.0 release, had been converted to C++, no longer supporting from C.
In 2000, Thomas E. Dickey, ported Berkeley Yacc to VMS to facilitate porting tin to VMS. After failing to find another maintainer, Dickey has maintained Berkeley Yacc since February 2002. A significant update was the conversion from K&R C to ANSI C89.
In 2014, Tom Shields integrated BtYacc backtracking into Berkeley Yacc effectively subsuming BtYacc and again supporting C in Dickey releases since April 2014.