How to find shift/reduce conflict in this yacc file?

后端 未结 5 683
时光说笑
时光说笑 2020-12-23 15:22

When I try to use yacc on the following file I get the error conflicts: 1 shift/reduce How can I find and fix the conflict?

/* C-Minus BNF Grammar */

%token         


        
5条回答
  •  误落风尘
    2020-12-23 15:46

    maybe you should try a yacc -v , it generates an output of the details.

    I tested here, and your grammar description fails in the classic "dangling else" problem.

    Take a look at this Wikipedia article.

提交回复
热议问题