1

语法如下:

terminal TERM1,TERM2;
non terminal  entry, sector, unit_a, unit_b;

entry ::= sector unit_b;    
sector ::= unit_a sector | unit_a;    
unit_a ::= TERM1 TERM1;    
unit_b ::= TERM1 TERM2;

当我尝试使用 jcup 生成解析器时,我收到以下警告

Warning : *** Shift/Reduce conflict found in state #1
  between sector ::= unit_a (*) 
  and     unit_a ::= (*) TERM1 TERM1 
  under symbol TERM1
  Resolved in favor of shifting.

Warning : *** Production "sector ::= unit_a " never reduced

我怎样才能找到导致这种冲突的原因?

4

0 回答 0