extract grammars with lexical productions