Continued-fraction expansions for ratios of generalized polynomials