Re: YACC: syntax errors

Henner Zeller <zeller@fh-heilbronn.de>
19 Jan 1997 21:50:11 -0500

          From comp.compilers

Related articles
YACC: syntax errors gclind01@starbase.spd.louisville.edu (1997-01-16)
Re: YACC: syntax errors snicol@apk.net (1997-01-17)
Re: YACC: syntax errors zeller@fh-heilbronn.de (Henner Zeller) (1997-01-19)
| List of all articles for this month |

From: Henner Zeller <zeller@fh-heilbronn.de>
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
'cause


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


-hen
-------
Henner Zeller
zeller@fh-heilbronn.de
--


Post a followup to this message

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