Added function for write afs ast-tree to file