representing code to generate as a tree