mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
This is something that has always bothered me: with pure parsers (and they all should be) the user does not have an (easy) access to yynerrs at the end of the parse. In the case of error recovery, that's the only direct means to know if there were errors. The usual approach being having the user maintain a counter incremented each time yyerror is called. So here, also capture yynerrs in the return value of the start-symbol parsing functions. * data/skeletons/yacc.c (yy_parse_impl_t): New. (yy_parse_impl): Use it. (b4_accept): Fill it. * examples/c/lexcalc/parse.y, examples/c/lexcalc/scan.l: No longer pass nerrs as lex- and parse-param, just use the resulting yynerrs. bistromathic and reccalc both demonstrate %param.