grammars for types