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

项目:Openjsharp    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:Openjsharp    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,final int targetLen,final int emptyInfo) {
    final int numRepeat = regex.numRepeat;
    addOpcode(qn.greedy ? OPCode.REPEAT : OPCode.REPEAT_NG);
    addMemNum(numRepeat); /* OP_REPEAT ID */
    regex.numRepeat++;
    addRelAddr(targetLen + OPSize.REPEAT_INC);

    entryRepeatRange(numRepeat,qn.lower,qn.upper);

    compileTreeEmptyCheck(qn.target,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:openjdk9    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:openjdk9    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:kaziranga    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:kaziranga    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:lookaside_java-1.8.0-openjdk    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:lookaside_java-1.8.0-openjdk    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:jdk8u_nashorn    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:jdk8u_nashorn    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:infobip-open-jdk-8    文件ArrayCompiler.java   
private static int compileLengthcclassNode(final cclassNode cc) {
    if (cc.isShare()) {
        return OPSize.OPCODE + OPSize.POINTER;
    }

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:infobip-open-jdk-8    文件ArrayCompiler.java   
private void compileRangeRepeatNode(final QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:OLD-OpenJDK8    文件ArrayCompiler.java   
private int compileLengthcclassNode(cclassNode cc) {
    if (cc.isShare()) return OPSize.OPCODE + OPSize.POINTER;

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:OLD-OpenJDK8    文件ArrayCompiler.java   
private void compileRangeRepeatNode(QuantifierNode qn,int targetLen,int emptyInfo) {
    int numRepeat = regex.numRepeat;
    addOpcode(qn.greedy ? OPCode.REPEAT : OPCode.REPEAT_NG);
    addMemNum(numRepeat); /* OP_REPEAT ID */
    regex.numRepeat++;
    addRelAddr(targetLen + OPSize.REPEAT_INC);

    entryRepeatRange(numRepeat,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:nashorn-backport    文件ArrayCompiler.java   
private int compileLengthcclassNode(cclassNode cc) {
    if (cc.isShare()) return OPSize.OPCODE + OPSize.POINTER;

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:nashorn-backport    文件ArrayCompiler.java   
private void compileRangeRepeatNode(QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:nashorn    文件ArrayCompiler.java   
private int compileLengthcclassNode(cclassNode cc) {
    if (cc.isShare()) return OPSize.OPCODE + OPSize.POINTER;

    int len;
    if (cc.mbuf == null) {
        len = OPSize.OPCODE + BitSet.BITSET_SIZE;
    } else {
        if (cc.bs.isEmpty()) {
            len = OPSize.OPCODE;
        } else {
            len = OPSize.OPCODE + BitSet.BITSET_SIZE;
        }

        len += OPSize.LENGTH + cc.mbuf.used;
    }
    return len;
}
项目:nashorn    文件ArrayCompiler.java   
private void compileRangeRepeatNode(QuantifierNode qn,emptyInfo);

    if (qn.isInRepeat()) {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC_SG : OPCode.REPEAT_INC_NG_SG);
    } else {
        addOpcode(qn.greedy ? OPCode.REPEAT_INC : OPCode.REPEAT_INC_NG);
    }

    addMemNum(numRepeat); /* OP_REPEAT ID */
}
项目:Openjsharp    文件ArrayCompiler.java   
@Override
protected void compileAltNode(final ConsAltNode node) {
    ConsAltNode aln = node;
    int len = 0;

    do {
        len += compileLengthTree(aln.car);
        if (aln.cdr != null) {
            len += OPSize.PUSH + OPSize.JUMP;
        }
    } while ((aln = aln.cdr) != null);

    final int pos = codeLength + len;  /* goal position */

    aln = node;
    do {
        len = compileLengthTree(aln.car);
        if (aln.cdr != null) {
            addOpcodeRelAddr(OPCode.PUSH,len + OPSize.JUMP);
        }
        compileTree(aln.car);
        if (aln.cdr != null) {
            len = pos - (codeLength + OPSize.JUMP);
            addOpcodeRelAddr(OPCode.JUMP,len);
        }
    } while ((aln = aln.cdr) != null);
}
项目:Openjsharp    文件ArrayCompiler.java   
private static int addCompileStringlength(final char[] chars,final int p,final int strLength,final boolean ignoreCase) {
    final int op = selectStrOpcode(strLength,ignoreCase);
    int len = OPSize.OPCODE;

    if (Config.USE_STRING_TEMPLATES && opTemplated(op)) {
        // string length,template index,template string pointer
        len += OPSize.LENGTH + OPSize.INDEX + OPSize.INDEX;
    } else {
        if (isNeedStrLenopExact(op)) {
            len += OPSize.LENGTH;
        }
        len += strLength;
    }
    return len;
}
项目:Openjsharp    文件ArrayCompiler.java   
private int compileLengthOptionNode(final EncloseNode node) {
    final int prev = regex.options;
    regex.options = node.option;
    final int tlen = compileLengthTree(node.target);
    regex.options = prev;

    if (isDynamic(prev ^ node.option)) {
        return OPSize.SET_OPTION_PUSH + OPSize.SET_OPTION + OPSize.FAIL + tlen + OPSize.SET_OPTION;
    }
    return tlen;
}
项目:Openjsharp    文件ArrayCompiler.java   
private int compileLengthEncloseNode(final EncloseNode node) {
    if (node.isOption()) {
        return compileLengthOptionNode(node);
    }

    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case EncloseType.MEMORY:
        if (bsAt(regex.btMemStart,node.regNum)) {
            len = OPSize.MEMORY_START_PUSH;
        } else {
            len = OPSize.MEMORY_START;
        }
        len += tlen + (bsAt(regex.btMemEnd,node.regNum) ? OPSize.MEMORY_END_PUSH : OPSize.MEMORY_END);
        break;

    case EncloseType.STOP_BACKTRACK:
        if (node.isstopBtSimpleRepeat()) {
            final QuantifierNode qn = (QuantifierNode)node.target;
            tlen = compileLengthTree(qn.target);
            len = tlen * qn.lower + OPSize.PUSH + tlen + OPSize.POP + OPSize.JUMP;
        } else {
            len = OPSize.PUSH_STOP_BT + tlen + OPSize.POP_STOP_BT;
        }
        break;

    default:
        newInternalException(ERR_PARSER_BUG);
        return 0; // not reached
    } // switch
    return len;
}
项目:Openjsharp    文件ArrayCompiler.java   
private int compileLengthAnchorNode(final AnchorNode node) {
    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case AnchorType.PREC_READ:
        len = OPSize.PUSH_POS + tlen + OPSize.POP_POS;
        break;

    case AnchorType.PREC_READ_NOT:
        len = OPSize.PUSH_POS_NOT + tlen + OPSize.FAIL_POS;
        break;

    case AnchorType.LOOK_BEHIND:
        len = OPSize.LOOK_BEHIND + tlen;
        break;

    case AnchorType.LOOK_BEHIND_NOT:
        len = OPSize.PUSH_LOOK_BEHIND_NOT + tlen + OPSize.FAIL_LOOK_BEHIND_NOT;
        break;

    default:
        len = OPSize.OPCODE;
        break;
    } // switch
    return len;
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
@Override
protected void compileAltNode(final ConsAltNode node) {
    ConsAltNode aln = node;
    int len = 0;

    do {
        len += compileLengthTree(aln.car);
        if (aln.cdr != null) {
            len += OPSize.PUSH + OPSize.JUMP;
        }
    } while ((aln = aln.cdr) != null);

    final int pos = codeLength + len;  /* goal position */

    aln = node;
    do {
        len = compileLengthTree(aln.car);
        if (aln.cdr != null) {
            addOpcodeRelAddr(OPCode.PUSH,len);
        }
    } while ((aln = aln.cdr) != null);
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private static int addCompileStringlength(final char[] chars,template string pointer
        len += OPSize.LENGTH + OPSize.INDEX + OPSize.INDEX;
    } else {
        if (isNeedStrLenopExact(op)) {
            len += OPSize.LENGTH;
        }
        len += strLength;
    }
    return len;
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private int compileLengthOptionNode(final EncloseNode node) {
    final int prev = regex.options;
    regex.options = node.option;
    final int tlen = compileLengthTree(node.target);
    regex.options = prev;

    if (isDynamic(prev ^ node.option)) {
        return OPSize.SET_OPTION_PUSH + OPSize.SET_OPTION + OPSize.FAIL + tlen + OPSize.SET_OPTION;
    }
    return tlen;
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private int compileLengthEncloseNode(final EncloseNode node) {
    if (node.isOption()) {
        return compileLengthOptionNode(node);
    }

    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case EncloseType.MEMORY:
        if (bsAt(regex.btMemStart,node.regNum) ? OPSize.MEMORY_END_PUSH : OPSize.MEMORY_END);
        break;

    case EncloseType.STOP_BACKTRACK:
        if (node.isstopBtSimpleRepeat()) {
            final QuantifierNode qn = (QuantifierNode)node.target;
            tlen = compileLengthTree(qn.target);
            len = tlen * qn.lower + OPSize.PUSH + tlen + OPSize.POP + OPSize.JUMP;
        } else {
            len = OPSize.PUSH_STOP_BT + tlen + OPSize.POP_STOP_BT;
        }
        break;

    default:
        newInternalException(ERR_PARSER_BUG);
        return 0; // not reached
    } // switch
    return len;
}
项目:openjdk-jdk10    文件ArrayCompiler.java   
private int compileLengthAnchorNode(final AnchorNode node) {
    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case AnchorType.PREC_READ:
        len = OPSize.PUSH_POS + tlen + OPSize.POP_POS;
        break;

    case AnchorType.PREC_READ_NOT:
        len = OPSize.PUSH_POS_NOT + tlen + OPSize.FAIL_POS;
        break;

    case AnchorType.LOOK_BEHIND:
        len = OPSize.LOOK_BEHIND + tlen;
        break;

    case AnchorType.LOOK_BEHIND_NOT:
        len = OPSize.PUSH_LOOK_BEHIND_NOT + tlen + OPSize.FAIL_LOOK_BEHIND_NOT;
        break;

    default:
        len = OPSize.OPCODE;
        break;
    } // switch
    return len;
}
项目:openjdk9    文件ArrayCompiler.java   
@Override
protected void compileAltNode(final ConsAltNode node) {
    ConsAltNode aln = node;
    int len = 0;

    do {
        len += compileLengthTree(aln.car);
        if (aln.cdr != null) {
            len += OPSize.PUSH + OPSize.JUMP;
        }
    } while ((aln = aln.cdr) != null);

    final int pos = codeLength + len;  /* goal position */

    aln = node;
    do {
        len = compileLengthTree(aln.car);
        if (aln.cdr != null) {
            addOpcodeRelAddr(OPCode.PUSH,len);
        }
    } while ((aln = aln.cdr) != null);
}
项目:openjdk9    文件ArrayCompiler.java   
private static int addCompileStringlength(final char[] chars,template string pointer
        len += OPSize.LENGTH + OPSize.INDEX + OPSize.INDEX;
    } else {
        if (isNeedStrLenopExact(op)) {
            len += OPSize.LENGTH;
        }
        len += strLength;
    }
    return len;
}
项目:openjdk9    文件ArrayCompiler.java   
private int compileLengthOptionNode(final EncloseNode node) {
    final int prev = regex.options;
    regex.options = node.option;
    final int tlen = compileLengthTree(node.target);
    regex.options = prev;

    if (isDynamic(prev ^ node.option)) {
        return OPSize.SET_OPTION_PUSH + OPSize.SET_OPTION + OPSize.FAIL + tlen + OPSize.SET_OPTION;
    }
    return tlen;
}
项目:openjdk9    文件ArrayCompiler.java   
private int compileLengthEncloseNode(final EncloseNode node) {
    if (node.isOption()) {
        return compileLengthOptionNode(node);
    }

    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case EncloseType.MEMORY:
        if (bsAt(regex.btMemStart,node.regNum) ? OPSize.MEMORY_END_PUSH : OPSize.MEMORY_END);
        break;

    case EncloseType.STOP_BACKTRACK:
        if (node.isstopBtSimpleRepeat()) {
            final QuantifierNode qn = (QuantifierNode)node.target;
            tlen = compileLengthTree(qn.target);
            len = tlen * qn.lower + OPSize.PUSH + tlen + OPSize.POP + OPSize.JUMP;
        } else {
            len = OPSize.PUSH_STOP_BT + tlen + OPSize.POP_STOP_BT;
        }
        break;

    default:
        newInternalException(ERR_PARSER_BUG);
        return 0; // not reached
    } // switch
    return len;
}
项目:openjdk9    文件ArrayCompiler.java   
private int compileLengthAnchorNode(final AnchorNode node) {
    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case AnchorType.PREC_READ:
        len = OPSize.PUSH_POS + tlen + OPSize.POP_POS;
        break;

    case AnchorType.PREC_READ_NOT:
        len = OPSize.PUSH_POS_NOT + tlen + OPSize.FAIL_POS;
        break;

    case AnchorType.LOOK_BEHIND:
        len = OPSize.LOOK_BEHIND + tlen;
        break;

    case AnchorType.LOOK_BEHIND_NOT:
        len = OPSize.PUSH_LOOK_BEHIND_NOT + tlen + OPSize.FAIL_LOOK_BEHIND_NOT;
        break;

    default:
        len = OPSize.OPCODE;
        break;
    } // switch
    return len;
}
项目:kaziranga    文件ArrayCompiler.java   
@Override
protected void compileAltNode(final ConsAltNode node) {
    ConsAltNode aln = node;
    int len = 0;

    do {
        len += compileLengthTree(aln.car);
        if (aln.cdr != null) {
            len += OPSize.PUSH + OPSize.JUMP;
        }
    } while ((aln = aln.cdr) != null);

    final int pos = codeLength + len;  /* goal position */

    aln = node;
    do {
        len = compileLengthTree(aln.car);
        if (aln.cdr != null) {
            addOpcodeRelAddr(OPCode.PUSH,len);
        }
    } while ((aln = aln.cdr) != null);
}
项目:kaziranga    文件ArrayCompiler.java   
private static int addCompileStringlength(final char[] chars,template string pointer
        len += OPSize.LENGTH + OPSize.INDEX + OPSize.INDEX;
    } else {
        if (isNeedStrLenopExact(op)) {
            len += OPSize.LENGTH;
        }
        len += strLength;
    }
    return len;
}
项目:kaziranga    文件ArrayCompiler.java   
private int compileLengthOptionNode(final EncloseNode node) {
    final int prev = regex.options;
    regex.options = node.option;
    final int tlen = compileLengthTree(node.target);
    regex.options = prev;

    if (isDynamic(prev ^ node.option)) {
        return OPSize.SET_OPTION_PUSH + OPSize.SET_OPTION + OPSize.FAIL + tlen + OPSize.SET_OPTION;
    }
    return tlen;
}
项目:kaziranga    文件ArrayCompiler.java   
private int compileLengthEncloseNode(final EncloseNode node) {
    if (node.isOption()) {
        return compileLengthOptionNode(node);
    }

    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case EncloseType.MEMORY:
        if (bsAt(regex.btMemStart,node.regNum) ? OPSize.MEMORY_END_PUSH : OPSize.MEMORY_END);
        break;

    case EncloseType.STOP_BACKTRACK:
        if (node.isstopBtSimpleRepeat()) {
            final QuantifierNode qn = (QuantifierNode)node.target;
            tlen = compileLengthTree(qn.target);
            len = tlen * qn.lower + OPSize.PUSH + tlen + OPSize.POP + OPSize.JUMP;
        } else {
            len = OPSize.PUSH_STOP_BT + tlen + OPSize.POP_STOP_BT;
        }
        break;

    default:
        newInternalException(ERR_PARSER_BUG);
        return 0; // not reached
    } // switch
    return len;
}
项目:kaziranga    文件ArrayCompiler.java   
private int compileLengthAnchorNode(final AnchorNode node) {
    int tlen;
    if (node.target != null) {
        tlen = compileLengthTree(node.target);
    } else {
        tlen = 0;
    }

    int len;
    switch (node.type) {
    case AnchorType.PREC_READ:
        len = OPSize.PUSH_POS + tlen + OPSize.POP_POS;
        break;

    case AnchorType.PREC_READ_NOT:
        len = OPSize.PUSH_POS_NOT + tlen + OPSize.FAIL_POS;
        break;

    case AnchorType.LOOK_BEHIND:
        len = OPSize.LOOK_BEHIND + tlen;
        break;

    case AnchorType.LOOK_BEHIND_NOT:
        len = OPSize.PUSH_LOOK_BEHIND_NOT + tlen + OPSize.FAIL_LOOK_BEHIND_NOT;
        break;

    default:
        len = OPSize.OPCODE;
        break;
    } // switch
    return len;
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...