implement copy_ast()