I've found it worth while to expose all my students dealing with yacc to
an illustrated version of byacc. (Authors: byacc: Bob Corbett,
illustrations: Jim Roskind.)

Mr Roskind's small changes to the byacc driver template will replace the
standard "yydebug messages" indicating current state and action of the
parser with a much more comprehensible graphical output. I've appended a
real life example of an Modula2 parse below. We were pretty in the dark
about the effects of interspersed error symbols until we made small
experiments with this enhanced yacc. The students can see the difference
between discarding states and symbols, the reduction of the error symbol,
the exact timing of events in a rule like "foo: bar {A;} error {B;} ';'",
and more.

You will find Jim Roskind's enhanced driver skeleton for byacc
packaged with his C++-grammar.

Martin Neitzel

So here is the promised example. It's a bit lengthy (90 lines), but it
should "give you the picture". There's a rule "IdentList: error" in the
grammar, see what happens during the faulty input "*+-":