I've just upgraded to Bison 2.1 and found that it generates bad code.
(The same grammar works fine with Bison 1.875b.)
The generated code contains:
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()
;
#endif
#endif
{
Note the final semicolon on the 4th-last line. It causes a syntax error
because a semicolon immediately follows the function
header, before the opening brace.
With Bison 1.875b, that semicolon wasn't generated.
Cheers,
Michi.