Growth and ergodicity of context-free languages