ast_allocate function done