Satya's Bison Page


What is GNU Bison?

Bison is a general-purpose parser generator that converts an annotated context-free grammar into an LALR(1) or GLR parser for that grammar. The current version of Bison can generate parsers in C and C++ languages. A Java skeleton is currently under development.

Graphviz output

I submitted a patch to output the generated LALR(1) automaton as a graphviz source file. The --graph command line option now generates a file that can be parsed and manipulated by the ``dot'' tool. Here is a sample output. This patch is now merged into Bison (2.3+).

Interactive mode Bison

A gdb style command line debugger for grammars. This tool can be used to debug the structure of your grammar. You can test-parse sample input and see what shifts/reductions are taking place on the parse stack after each token in consumed. You can set break points at required tokens and adjust input at runtime.

Understanding parsers generated by Bison

Do you want to know how an LALR parser works in the real world? Then this article is for you. It compares ``theoretical'' LALR parsing tables illustrated by compiler text books to the real world tables generated by GNU bison and gives an in-depth explanation of how a parser produced by GNU Bison operates.

<<< Back to my home page