微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType的实例源码

项目:Openjsharp    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,token.backP,p); // tk_byte:
    while (true) {
        fetchToken();
        if (token.type != TokenType.STRING) {
            break;
        }

        if (token.backP == node.end) {
            node.end = p; // non escaped character,remain shared,just increase shared range
        } else {
            node.cat(chars,p); // non continuous string stream,need to COW
        }
    }
    // targetp = node;
    return parseExpRepeat(node,group); // string_end:,goto repeat
}
项目:Openjsharp    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null);
    ConsAltNode t = top;

    while (token.type != TokenType.EOT && token.type != term && token.type != TokenType.ALT) {
        node = parseExp(term);
        if (node.getType() == NodeType.LIST) {
            t.setCdr((ConsAltNode)node);
            while (((ConsAltNode)node).cdr != null ) {
                node = ((ConsAltNode)node).cdr;
            }

            t = ((ConsAltNode)node);
        } else {
            t.setCdr(ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:Openjsharp    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null);
        ConsAltNode t = top;
        while (token.type == TokenType.ALT) {
            fetchToken();
            node = parseBranch(term);

            t.setCdr(ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:Openjsharp    文件Lexer.java   
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);
    }
}
项目:Openjsharp    文件Lexer.java   
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);
    }
}
项目:Openjsharp    文件Lexer.java   
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignednumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (Syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (Syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
项目:Openjsharp    文件Lexer.java   
private void fetchTokenFor_zero() {
    if (Syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        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.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
项目:openjdk-jdk10    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,goto repeat
}
项目:openjdk-jdk10    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:openjdk-jdk10    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:openjdk-jdk10    文件Lexer.java   
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);
    }
}
项目:openjdk-jdk10    文件Lexer.java   
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);
    }
}
项目:openjdk-jdk10    文件Lexer.java   
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignednumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (Syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (Syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
项目:openjdk-jdk10    文件Lexer.java   
private void fetchTokenFor_zero() {
    if (Syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        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.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
项目:openjdk9    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,goto repeat
}
项目:openjdk9    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:openjdk9    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:openjdk9    文件Lexer.java   
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);
    }
}
项目:openjdk9    文件Lexer.java   
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);
    }
}
项目:openjdk9    文件Lexer.java   
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignednumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (Syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (Syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
项目:openjdk9    文件Lexer.java   
private void fetchTokenFor_zero() {
    if (Syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        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.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
项目:kaziranga    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,goto repeat
}
项目:kaziranga    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:kaziranga    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:kaziranga    文件Lexer.java   
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);
    }
}
项目:kaziranga    文件Lexer.java   
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);
    }
}
项目:kaziranga    文件Lexer.java   
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignednumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (Syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (Syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
项目:kaziranga    文件Lexer.java   
private void fetchTokenFor_zero() {
    if (Syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        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.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,goto repeat
}
项目:lookaside_java-1.8.0-openjdk    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:lookaside_java-1.8.0-openjdk    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:lookaside_java-1.8.0-openjdk    文件Lexer.java   
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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件Lexer.java   
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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件Lexer.java   
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignednumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (Syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (Syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
项目:lookaside_java-1.8.0-openjdk    文件Lexer.java   
private void fetchTokenFor_zero() {
    if (Syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        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.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
项目:jdk8u_nashorn    文件Parser.java   
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars,goto repeat
}
项目:jdk8u_nashorn    文件Parser.java   
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node,null));
            t = t.cdr;
        }
    }
    return top;
}
项目:jdk8u_nashorn    文件Parser.java   
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node,null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
项目:jdk8u_nashorn    文件Lexer.java   
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);
    }
}
项目:jdk8u_nashorn    文件Lexer.java   
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);
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。