title: How does associativity affects the order of evaluation of operands?
body: <p>In compiler design ,If I have a grammar defined as </p>
  
  <pre><code>E--&gt;E+E/E-E/id
  T--&gt;id
  </code></pre>
  
  <p>Now since this grammar is left-recursive and also we can say that both the + and - operators are left-associative so then when the parse tree would be constructed ,so if I have an input like id+id-id ,so then first id+id would be executed and then the result of addition would subtract id .</p>
  
  <p>And if I have an input string like id+id+id ,then in that case execution order would be (id+id)+id .</p>
  
  <p>I am not getting this concept as I have studied that Associativity of operators do not define the order of evaluation ,if that is so true then what about the parse tree generation because if we are asked to compare two parse trees and find which one would work properly if say I have an input string like id+id-id,then we would chose the parse tree wherein we have the order of evaluation such that the subtree which is rooted at node + would be executed first and then the subtree rooted at - would be executed first ,so please clarify me the actual parameters which decide the order of evaluation in the c program.</p>