Movement Primitives are a well studied and widely applied concept in modern robotics. Composing primitives out of an existing library, however, has shown to be a challenging problem. We propose the use of probabilistic context-free grammars to sequence a series of primitives to generate complex robot policies from a given library of primitives. The rule-based nature of formal grammars allows an intuitive encoding of hierarchically and recursively structured tasks. This hierarchical concept strongly connects with the way robot policies can be learned, organized, and re-used. However, the induction of context-free grammars has proven to be a complicated and yet unsolved challenge. In this work, we exploit the physical nature of robot movement primitives to restrict and efficiently search the grammar space. The grammar is learned with Markov Chain Monte Carlo optimization over the posteriors of the grammars given the observations. Restrictions over operators connecting the search define the corresponding proposal distributions and, therefore, guide the optimization additionally. In experiments, we validate our method on a redundant 7 degree-of-freedom lightweight robotic arm on tasks that require the generation of complex sequences of motions out of simple primitives.