In this paper, a new approach to grammatical evolution is presented. The aim is to generate complete programs using probabilistic modeling and sampling of (probability) distribution of given grammars. To be exact, probabilistic context free grammars are employed and a modified mapping process is developed to create new individuals from the distribution of grammars. To consider problem structures in the individual generation, conditional dependencies between production rules are incorporated into the mapping process. Experiments confirm that the proposed algorithm is more effective than existing methods.