我是Bison的新手,遇到了移进/规约冲突的问题......我正在尝试从文件中加载到数组data[]
:
struct _data
{
char name[50];
char surname[50];
int year;
} data[1000];
这是我 bison 代码的一部分:
%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); }
;
%%
我遇到了这个错误:
conflicts: 5 shift/reduce
我哪里做错了,有什么想法吗?