parser/tokenizer: Use free and ensure clean state

* Use free() instead of delete for things allocated by the C standard
  library (such as strings returned by strdup() or format())
! Make sure the state is clean before parsing the token list (i.e.,
  reset the list of keywords, etc.)

Signed-off-by: Max Reitz <xanclic@niwohlos.org>
specs: Simplify parserspec::ex1

* Move the file operations into a dedicated function

Signed-off-by: Max Reitz <xanclic@niwohlos.org>
specs: Add parserspec::ex2

+ This tests whether template parameters are detected as types

Signed-off-by: Max Reitz <xanclic@niwohlos.org>