title: Warning: 2 shift/reduce conflicts [-Wconflicts-sr] err
body: <pre><code>%{
  #include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int regs[30];
  %}
  %token NUMBER LETTER
  %left  PLUS MINUS 
  %left MULT DIV 
  %%
  
  prog: prog st | ; //when I remove this line the error goes
  st : E {printf("ans %d", $1);}| LETTER '=' E {regs[$1] = $3; printf("variable contains %d",regs[$1]);}; 
  E :  E PLUS E{$$ = $1 + $3;} //addition
  | E MINUS E{$$ = $1 - $3 ;} //subtraction
  | MINUS E{$$ = -$2;} 
  | E MULT E{$$ = $1 * $3 ;} 
  | E DIV E { if($3)$$= $1 / $3; else yyerror("Divide by 0");} 
  /*|LBRACE E RBRACE{$$= $2;} 
  | RBRACE E LBRACE{yyerror("Wrong expression");} */
  | NUMBER {$$ = $1;}
  | LETTER {$$ = regs[$1];}
  ;
  %%
  
  int main(void)
  {
  printf("Enter Expression: ");
  yyparse();
  return 0;
  }
  
  int yyerror(char *msg)
  {
  printf("%s", msg);// printing error
  exit(0);
  }
  </code></pre>
  
  <p>I am not able to resolve the conflicts. Also I am getting a segmentation fault when I run it with some edits. I am using yacc and lex for the same.</p>