This paper tackles shape grammar parsing for facade segmentation using a novel optimization approach based on reinforcement learning (RL). To this end, we use a binary recursive grammar. A semantic segmentation of the image is seen as the result of a hierarchical markovian decision process (grammar derivation). We introduce a RL approach to parse a given image with a shape grammar, using simple image cues as data terms. Our formulation allows us to genuinely optimize the geometry and the topology of the facade simultaneously. We achieve state-of-the-art results on facade parsing, with a significant speed-up compared to existing methods. No assumptions on the facade topology are made, while the method is not sensitive to the initial conditions. Last, but not least the proposed method inherits theoretical guarantee regarding its convergence. Our results on a standard benchmark compare favorably with the state of the art methods both in terms of computational efficiency and accuracy.