Java Code Examples for jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType#CODE_POINT

The following examples show how to use jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType#CODE_POINT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Lexer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) return;
    int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 2
Source File: Lexer.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) return;
    int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 3
Source File: Lexer.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) return;
    int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 4
Source File: Lexer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 5
Source File: Lexer.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 6
Source File: Lexer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 7
Source File: Lexer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) return;
    int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 8
Source File: Lexer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 9
Source File: Lexer.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 10
Source File: Lexer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 11
Source File: Lexer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 12
Source File: Lexer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 13
Source File: Lexer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void fetchTokenFor_uHex() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
Example 14
Source File: Lexer.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) return token.type;
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 15
Source File: Lexer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) {
            return token.type;
        }
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            }
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            }
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            final int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 16
Source File: Lexer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) {
            return token.type;
        }
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            }
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            }
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            final int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 17
Source File: Lexer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) return token.type;
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 18
Source File: Lexer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) {
            return token.type;
        }
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            }
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            }
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            final int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 19
Source File: Lexer.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) {
            return token.type;
        }
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            }
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            }
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            final int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}
 
Example 20
Source File: Lexer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected final TokenType fetchTokenInCC() {
    if (!left()) {
        token.type = TokenType.EOT;
        return token.type;
    }

    fetch();
    token.type = TokenType.CHAR;
    token.setC(c);
    token.escaped = false;

    if (c == ']') {
        token.type = TokenType.CC_CLOSE;
    } else if (c == '-') {
        token.type = TokenType.CC_RANGE;
    } else if (c == syntax.metaCharTable.esc) {
        if (!syntax.backSlashEscapeInCC()) {
            return token.type;
        }
        if (!left()) {
            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
        }
        fetch();
        token.escaped = true;
        token.setC(c);

        switch (c) {
        case 'w':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'W':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.W : CharacterType.WORD);
            break;
        case 'd':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 'D':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.D : CharacterType.DIGIT);
            break;
        case 's':
            fetchTokenInCCFor_charType(false, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'S':
            fetchTokenInCCFor_charType(true, Config.NON_UNICODE_SDW ? CharacterType.S : CharacterType.SPACE);
            break;
        case 'h':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(false, CharacterType.XDIGIT);
            }
            break;
        case 'H':
            if (syntax.op2EscHXDigit()) {
                fetchTokenInCCFor_charType(true, CharacterType.XDIGIT);
            }
            break;
        case 'x':
            fetchTokenInCCFor_x();
            break;
        case 'u':
            fetchTokenInCCFor_u();
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
            fetchTokenInCCFor_digit();
            break;

        default:
            unfetch();
            final int num = fetchEscapedValue();
            if (token.getC() != num) {
                token.setCode(num);
                token.type = TokenType.CODE_POINT;
            }
            break;
        } // switch

    } else if (c == '&') {
        fetchTokenInCCFor_and();
    }
    return token.type;
}