support reading ast files also, and write ast or gps