title: Bison shift-reduce conflict - Unable to resolve
body: <p>The grammar is as follows:</p>
  
  <pre><code>1. program -&gt; declaration-list
  2. declaration-list -&gt; declaration-list declaration | declaration
  3. declaration -&gt; var-declaration | fun-declaration
  4. var-declaration -&gt; type-specifier ID ; | type-specifier ID [ NUM ] ;
  5. type-specifier -&gt; int | void
  6. fun-declaration -&gt; type-specifier ID ( params ) compound-stmt
  7. params -&gt; param-list | void
  8. param-list -&gt; param-list , param | param
  9. param -&gt; type-specifier ID | type-specifier ID [ ]
  10. compound-stmt -&gt; { local-declarations statement-list }
  11. local-declarations -&gt; local-declarations var-declarations | empty
  12. statement-list -&gt; statement-list statement | empty
  13. statement -&gt; expression-stmt | compound-stmt | selection-stmt |
  iteration-stmt | return-stmt
  14. expression-stmt -&gt; expression ; | ;
  15. selection-stmt -&gt; if ( expression ) statement |
  if ( expression ) statement else statement
  16. iteration-stmt -&gt; while ( expression ) statement
  17. return-stmt -&gt; return ; | return expression ;
  18. expression -&gt; var = expression | simple-expression
  19. var -&gt; ID | ID [ expression ]
  20. simple-expression -&gt; additive-expression relop additive-expression |
  additive-expression
  21. relop -&gt; &lt;= | &lt; | &gt; | &gt;= | == | !=
  22. additive-expression -&gt; additive-expression addop term | term
  23. addop -&gt; + | -
  24. term -&gt; term mulop factor | factor
  25. mulop -&gt; * | /
  26. factor -&gt; ( expression ) | var | call | NUM
  27. call -&gt; ID ( args )
  28. args -&gt; arg-list | empty
  29. arg-list -&gt; arg-list , expression | expression
  </code></pre>
  
  <p>The shift reduce conflict that I get through bison -d -v xyz.l is in state 97</p>
  
  <pre><code>state 97
  
     29 selection-stmt: IF LFT_BRKT expression RGT_BRKT statement .
     30               | IF LFT_BRKT expression RGT_BRKT statement . ELSE statement
  
      ELSE  shift, and go to state 100
  
      ELSE      [reduce using rule 29 (selection-stmt)]
      $default  reduce using rule 29 (selection-stmt)
  </code></pre>
  
  <p>But I do not know how to resolve this conflict. Waiting for an answer.</p>