implement reset for both parser and scanner.
complete the user agent parser.