X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/fd7f0289bcfa2e830439e37395fd91f0d7587a39..d72642d6915dbecd28609d307ef4676d1d5ab448:/src/print_graph.c diff --git a/src/print_graph.c b/src/print_graph.c index 6ca44c05..76d8b3fe 100644 --- a/src/print_graph.c +++ b/src/print_graph.c @@ -1,6 +1,6 @@ /* Output a graph of the generated parser, for Bison. - Copyright (C) 2001-2007, 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2001-2007, 2009-2015 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -84,8 +84,11 @@ print_core (struct obstack *oout, state *s) obstack_1grow (oout, '.'); - for (/* Nothing */; *sp >= 0; ++sp) - obstack_printf (oout, " %s", escape (symbols[*sp]->tag)); + if (0 <= *r->rhs) + for (/* Nothing */; *sp >= 0; ++sp) + obstack_printf (oout, " %s", escape (symbols[*sp]->tag)); + else + obstack_printf (oout, " %%empty"); /* Experimental feature: display the lookahead tokens. */ if (report_flag & report_lookahead_tokens