title: How to remove shift/reduce conflicts on variable declarations in bison?
body: <p>I'm working on my compiler design project and i have to remove all ambiguities from this grammar. At first, the following code(.yac) had 27 shift/reduce conflicts with 3 reduce/reduce conflicts. I managed to make them only 15 shift/reduce conflicts and by now i can see that there are only conflicts on variable declarations like <strong>BOOLEAN_KW</strong>, <strong>CHRACTAR_KW</strong>, etc. I really need to solve this problem and i know that some <strong>Precedence</strong> or <strong>Priority</strong> need to be used here, and i have tested a lot of possibilites, but no success. If someone could have helped me with this output file of bison which shows the conflicts on shift/reduce, i would be greatly thankful.
  By the way, I guess that these reduce/conflicts are some warnings that bison gives me for acknowledgment purposes, But unfortunately even knowing that doesn't let me run the whole <strong>lexer</strong> and <strong>parser</strong> with my main program and i get this error while trying to run the whole code:</p>
  
  <pre><code>    Error : syntax error
  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
      at YYParser$YYStack.stateAt(YYParser.java:315)
      at YYParser.parse(YYParser.java:1568)
      at global.main(global.java:39)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
  </code></pre>
  
  <p>And finally, here is my output from the <strong>-o output</strong> option with <strong>--verbose</strong> enabled using bison which shows the conflicts in the early section of the code:
  <a href="https://github.com/aligholamee/Chronicle/blob/master/Stackoverflow/output.output" rel="nofollow noreferrer">My code is uploaded here</a>.</p>