parser: generate parser with cache and position tracking

This should fix #284.
On the other hand the overall parsing time might be slower in the general case.