I'm new to Bison
and I'm having trouble with shift/reduce conflicts... I'm trying to load from file to array data[]
:
struct _data
{
char name[50];
char surname[50];
int year;
} data[1000];
Here is part of my bison code:
%token ID NUM NL EOF
%%
File : List EOF
;
List : Record
| List Record
;
Record : Name Surname Year NL { count++; }
| NL { count++; }
| /*empty*/
;
Name : ID { strcpy(data[count].name, yytext); }
;
Surname: ID { strcpy(data[count].surname, yytext); }
;
Year : NUM { data[count].year= atoi(yytext); }
;
%%
I get this error:
conflicts: 5 shift/reduce
Any idea where I went wrong?