char Hex2Char(String s) {
    int val = 0;
    for (int i = 0; i < s.length(); i++) {
      char ch = s.charAt(i);
      if ('0' <= ch && ch <= '9') val = 16 * val + (ch - '0');
      else if ('a' <= ch && ch <= 'f') val = 16 * val + (10 + ch - 'a');
      else if ('A' <= ch && ch <= 'F') val = 16 * val + (10 + ch - 'A');
      else parser.SemErr("bad escape sequence in string or character");
    }
    if (val > Character.MAX_VALUE) /* pdt */
      parser.SemErr("bad escape sequence in string or character");
    return (char) val;
  }