public char scanQuotedChar() throws StringScanException {
    StringScanException exception = null;
    char retval = 0;
    int idxSave = idx;
    
    skipWhiteSpace();
    if (idx == len) {
      exception = new StringScanException(idx, "end of input");
    } else if (buf[idx++] == '\'') {
      try {
        retval = scanUnquotedChar();
      } catch (StringScanException e) {
        exception = e;
      }
      if (exception == null) {
        if (idx == len) {
          exception = new StringScanException(idx, "end of input");
        } else if (buf[idx++] != '\'') {
          exception = new StringScanException(idx - 1,
            "unclosed quoted character");
        }
      }
    } else {
      exception = new StringScanException(idx - 1,
        "uninitialized quoted character");
    }
    if (exception != null) {
      idx = idxSave;
      throw exception;
    }
    return retval;
  }