I asked this question on stackoverflow.com, it has many details and graphics depicting what I am trying to do. http://stackoverflow.com/questions/13409927/how-to-get-rid-of-useless-nodes-from-this-ast-tree Can anyone help me get rid of these intermediate nodes? -- Jarrod Roberson