Generating functions for context-free languages
Solution 1:
The classical Chomsky-Schutzenberger theorem is established in a constructive manner by transforming an unambiguous grammatical specification of the language into a set of polynomial equations.
According to Flajolet. He gives some nice examples where the construction from grammar to generating function is given. Flajolet, TCS 1987