implement emit-ast option