title: if-else statement in bison
body: <p>I'm trying to do the if-then statement in bison. The problem is that im working on a solution that everyone says that is working, but it doesnt :( my code is:</p>
  
  <p>statement : matchedstmt<br>
      | unmatchedstmt<br>
      ;
  matchedstmt : if '(' expression ')' matchedstmt else matchedstmt </p>
  
  <pre><code>| otherstmt                 
  ;
  </code></pre>
  
  <p>unmatchedstmt : if '(' expression ')' statement </p>
  
  <pre><code>| if '('expression ')' matchedstmt else unmatchedstmt   
  ;
  </code></pre>
  
  <p>otherstmt :  expressionstmt </p>
  
  <pre><code>| compoundstmt  
  
  | iterationstmt     
  
  | returnstmt    
  ;
  </code></pre>
  
  <p>...</p>
  
  <p>where "if" &amp; "else" are %token</p>
  
  <p>!! in terminal it says that i have one shift/reduce.</p>
  
  <p>I also tried %nonassoc and %left</p>
  
  <p>what can i do??</p>