public static char unescape(char c) {
        switch (c) {
            case 'r': return '\r';
            case 'n': return '\n';
            case 't': return '\t';
            case '0': return '\0';
            case '\'': return '\'';
            case '"': return '"';
            case '\\': return '\\';
            default:
                throw new IllegalArgumentException("Invalid escape sequence: \\" + c);
        }
    }