tree walker for compile