static void skipComment(StdXMLReader reader)
      throws IOException,
             XMLParseException
   {
      if (reader.read() != '-') {
         XMLUtil.errorExpectedInput(reader.getSystemID(),
                                    reader.getLineNr(),
                                    "<!--");
      }
      
      int dashesRead = 0;

      for (;;) {
         char ch = reader.read();

         switch (ch) {
            case '-':
               dashesRead++;
               break;

            case '>':
               if (dashesRead == 2) {
                  return;
               }
               dashesRead = 0;
               break;

            default:
               dashesRead = 0;
         }
      }
   }