implement parser for some primitive types