我在野牛中有转移/减少冲突。
我检查了 parser.output 文件:
State 0
0 $accept: . Prog $end
STRUCT shift, and go to state 1
$default reduce using rule 6 (Structs)
Prog go to state 2
Structs go to state 3
StructDec go to state 4
我有规则:
Prog : Structs Funcs {};
Structs : StructDec Structs | {};
StructDec : STRUCT ID LB StrctMmLst RB SC{};
Prog 是开始符号。
%start Prog
我认为原因是结构的 epsilon 规则。如何在不改变含义的情况下解决它?