code: public void assertToken(final int token) throws ParseException {
      try {
        if (nextToken() != token) {
          throw new ParseException("Expected [" + token + "], read [" +
                                    ttype + "] at " + lineno());
        }
  
        if (debug()) {
          if (token > 0) {
            debug("[" + (char)token + "]");
          } else {
            debug("[" + token + "]");
          }
        }
      } catch (IOException e) {
        throw new ParseException(e);
      }
    }
docs: Asserts that the next token in the stream matches the specified token.
  
  @param token expected token
  @throws ParseException