O'Reilly logo

Compilers: Principles and Practice by Himanshu B. Dave, Parag H. Dave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.5 Other Parser Generators

4.5.1 Bison

Bison is a parser generator by GNU organization, similar to yacc, written mainly by Robert Corbett and Richard Stallman. It is generally upward compatible with input files designed for yacc.

Input files should follow the yacc convention of ending in .y. Unlike yacc, the generated files do not have fixed names, but instead use the prefix of the input file. Moreover, if you need to put C++ code in the input file, you can end the name by a C++ -like extension (.ypp or .y++), then bison will follow your extension to name the output file (.cpp or .c++). For instance, a grammar description file named parse .yxx would produce the generated parser in a file named parse. tab.cxx, instead of yacc's y.tab.c.

Bison ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required