Implement parser state as a template parameter.
Implement semantics.