Sono nuovo di Bison
e sto avendo problemi con lo spostamento/ridurre i conflitti ... Sto cercando di caricare da file array data[]
:Shift/ridurre i conflitti in bisonti
struct _data
{
char name[50];
char surname[50];
int year;
} data[1000];
Qui fa parte del mio codice bisonti:
%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); }
;
%%
ottengo questo errore:
conflicts: 5 shift/reduce
Qualsiasi idea di dove ho sbagliato?