add token format specification support (issue #5199)