A language-theoretic approach to covering problems