/** Read one of "<tag", "<?pi", "<!--", "<![CDATA[" or a end tag. */ protected void parseBeginSomething (Token token) { if (pos >= source.length ()) throw new XMLParseException ("Unexpected end of input. Expected start or end tag, processing instruction, comment or CDATA", source, pos); char c = source.charAt (pos); switch (c) { case '?': pos ++; parseProcessingInstruction (token); break; case '!': pos ++; parseExcalamation (token); break; case '/': pos ++; parseEndElement (token); break; default: parseBeginElement (token); break; } }