Working scanner, except for a few tokens.