functional token and error parsing