private final void parseDoctype() throws IOException {
		int nesting = 1;

		while (true) {
			switch (read()) {
				case -1:
					fail(UNEXPECTED_EOF);
					break;
				case '<':
					nesting++;
					break;
				case '>':
					if (--nesting == 0) {
						return;
					}
					break;
				default:
					break;
			}
		}
	}