Added function to print ast to user specified file pointer