Use a string scanner to parse the templates