Implement tracking of positions in the parser and error reporting.