我有以下規則,並在與野牛一起實施時,我會得到5次移位/減少警告。解決GnuWin32 Bison中的Shift/Reduce警告?
規則的部分是:
Type----> BOOL
| INT
| CHAR
| DOUBLE
| ID
| INT '['']'
;
rule: VarDec rule
| VarDec
;
VarDec: Type ID ';'
;
和Parser.output
給我的警告,在這種狀態下:
**state 25**
4 rule: VarDec . rule
5 | VarDec .
BOOL shift, and go to state 3
INT shift, and go to state 4
CHAR shift, and go to state 5
DOUBLE shift, and go to state 6
ID shift, and go to state 7
BOOL [reduce using rule 5 (rule)]
INT [reduce using rule 5 (rule)]
CHAR [reduce using rule 5 (rule)]
DOUBLE [reduce using rule 5 (rule)]
ID [reduce using rule 5 (rule)]
$default reduce using rule 5 (rule)
rule go to state 28
VarDec go to state 25
Type go to state 27
誰能幫助我如何解決這個問題,我讀了很多文章,但我無法弄清楚什麼是錯的,並且預先感謝每一個人...... :)