Analytic and Gevrey Hypoellipticity for a Class of Pseudodifferential Operators in One Variable