The most primitive token recogniser. The expression tokenPrimEx show nextpos mbnextstate test,
recognises tokens when test returns Just x (and returns the value x). Tokens are shown in
error messages using show. The position is calculated using nextpos, and finally, mbnextstate,
can hold a function that updates the user state on every token recognised (nice to count tokens :-).
The function is packed into a Maybe type for performance reasons.