Theory of dielectric grating antennas of finite width