Re: YACC: syntax errors

Henner Zeller <>
19 Jan 1997 21:50:11 -0500

          From comp.compilers

Related articles
YACC: syntax errors (1997-01-16)
Re: YACC: syntax errors (1997-01-17)
Re: YACC: syntax errors (Henner Zeller) (1997-01-19)
| List of all articles for this month |

From: Henner Zeller <>
Newsgroups: comp.compilers
Date: 19 Jan 1997 21:50:11 -0500
Organization: Compilers Central
Keywords: yacc, errors

On 17 Jan 1997, Scott Nicol wrote:
> >[Not without hacking the generated parser, which many people have done.
> -John]
> Yes, you can hack the parser to look at the debug information
> (i.e. the stuff generated to y.output) so that it can report what
> tokens would have been acceptable in the current state, but ...

The current bison-1.25 does this. If you #define YYERROR_VERBOSE at
compile-time it will call yyerror() with at message containing the
names of the next acceptable tokens - if there are less than five

> .. that could be a long list and might not be too useful.

Henner Zeller

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.