Many compiler optimization techniques depend on the ability to calculate the number of elementsthat satisfy certain conditions. If these conditions can be represented by linear constraints, then such problemsare equivalent to counting the number of integer points in (possibly) parametric polytopes.It is well known that the enumerator of such a set can be represented by an explicit function consisting ofa set of quasi-polynomials, each associated with a chamber in the parameter space. Previously, interpolationwas used to obtain these quasi-polynomials, but this technique has several disadvantages. Its worst-casecomputation time for a single quasi-polynomial is exponential in the input size, even for fixed dimensions.The worst-case size of such a quasi-polynomial (measured in bits needed to represent the quasi-polynomial)is also exponential in the input size. Under certain conditions this technique even fails to produce a solution.Our main contribution is a novel method for calculating the required quasi-polynomials analytically. Itextends an existing method, based on Barvinok�s decomposition, for counting the number of integer pointsin a non-parametric polytope. Our technique always produces a solution and computes polynomially-sizedenumerators in polynomial time (for fixed dimensions).