I'm working on a parser in Bison. When parsing a test case, Bison gives a syntax error, saying that it expected $end, but there were more tokens. I've searched the Bison manual for $end, but it doesn't seem to indicate in what conditions exactly it will expect that token. I've used a recursive rule of the form
%start program
%%
program
: rule
| program rule;
to define my grammar's root. Bison happily matches the first three invocations of rule but throws on the fourth one, saying that it expected $end. How can I indicate to Bison that it should expect and match more tokens?