title: Interpreter backend, how do you traverse your abstract syntax tree?
body: <p>I'm working on an interpreter and have not found a good explanation of how to traverse and abstract syntax tree after semantic analysis. I wondering what the correct way to do it is. I understand that you merge terminals into their parents processing from left to right and repeat this as much as you can.</p>
  <p>I have this abstract syntax tree, which may or may not be correct.</p>
  <p><a href="https://i.stack.imgur.com/RiLei.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RiLei.jpg" alt="ast" /></a><br />
  <sub>(source: <a href="http://theadesilva.com/so_1.jpg" rel="nofollow noreferrer">theadesilva.com</a>)</sub></p>
  <p>What do I do?</p>
  <p>merge 34 and 3 into *, then merge 4 and * into +, then merge ident into call and + into call? Is that right? What is a good algorithm to traverse a tree backwards like that?</p>