implement Primitive type parsing