Building reverse engineering or reengineering tools often requires parsers for many different programming languages. The diffusion of dialects and variants makes many available parsers almost useless. While manual grammar maintenance is feasible, it can be a long, tedious and expensive task. This paper proposes to adopt genetic algorithms to evolve existing grammars inferring changes from examples written using the dialect. Applying grammar inference from scratch may lead to a useless grammar, while the proposed approach simply applies changes to the original grammar when needed, thus producing a meaningful grammar. The paper reports some preliminary results related to the evolution of a C grammar.