synthesizing grammars