Next: , Previous: , Up: Bison   [Contents][Index]


8 Debugging Your Parser

Developing a parser can be a challenge, especially if you don’t understand the algorithm (see The Bison Parser Algorithm). This chapter explains how to understand and debug a parser.

The most frequent issue users face is solving their conflicts. To fix them, the first step is understanding how they arise in a given grammar. This is made much easier by automated generation of counterexamples, cover in the first section (see Generation of Counterexamples).

In most cases though, looking at the structure of the automaton is still needed. The following sections explain how to generate and read the detailed structural description of the automaton. There are several formats available:

The last section focuses on the dynamic part of the parser: how to enable and understand the parser run-time traces (see Tracing Your Parser).