当前位置: 首页>>代码示例>>Java>>正文


Java BackRefNode类代码示例

本文整理汇总了Java中jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode的典型用法代码示例。如果您正苦于以下问题:Java BackRefNode类的具体用法?Java BackRefNode怎么用?Java BackRefNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BackRefNode类属于jdk.nashorn.internal.runtime.regexp.joni.ast包,在下文中一共展示了BackRefNode类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compileBackrefNode

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
@Override
protected void compileBackrefNode(final BackRefNode node) {
    if (isIgnoreCase(regex.options)) {
        addOpcode(OPCode.BACKREFN_IC);
        addMemNum(node.backRef);
    } else {
        switch (node.backRef) {
            case 1:
                addOpcode(OPCode.BACKREF1);
                break;
            case 2:
                addOpcode(OPCode.BACKREF2);
                break;
            default:
                addOpcode(OPCode.BACKREFN);
                addOpcode(node.backRef);
                break;
        } // switch
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ArrayCompiler.java

示例2: compileBackrefNode

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
@Override
protected void compileBackrefNode(BackRefNode node) {
    if (isIgnoreCase(regex.options)) {
        addOpcode(OPCode.BACKREFN_IC);
        addMemNum(node.backRef);
    } else {
        switch (node.backRef) {
            case 1:
                addOpcode(OPCode.BACKREF1);
                break;
            case 2:
                addOpcode(OPCode.BACKREF2);
                break;
            default:
                addOpcode(OPCode.BACKREFN);
                addOpcode(node.backRef);
                break;
        } // switch
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:21,代码来源:ArrayCompiler.java

示例3: compileLengthTree

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
private int compileLengthTree(final Node node) {
    int len = 0;

    switch (node.getType()) {
    case NodeType.LIST:
        ConsAltNode lin = (ConsAltNode)node;
        do {
            len += compileLengthTree(lin.car);
        } while ((lin = lin.cdr) != null);
        break;

    case NodeType.ALT:
        ConsAltNode aln = (ConsAltNode)node;
        int n = 0;
        do {
            len += compileLengthTree(aln.car);
            n++;
        } while ((aln = aln.cdr) != null);
        len += (OPSize.PUSH + OPSize.JUMP) * (n - 1);
        break;

    case NodeType.STR:
        final StringNode sn = (StringNode)node;
        if (sn.isRaw()) {
            len = compileLengthStringRawNode(sn);
        } else {
            len = compileLengthStringNode(sn);
        }
        break;

    case NodeType.CCLASS:
        len = compileLengthCClassNode((CClassNode)node);
        break;

    case NodeType.CTYPE:
    case NodeType.CANY:
        len = OPSize.OPCODE;
        break;

    case NodeType.BREF:
        final BackRefNode br = (BackRefNode)node;

        len = ((!isIgnoreCase(regex.options) && br.backRef <= 2)
                ? OPSize.OPCODE : (OPSize.OPCODE + OPSize.MEMNUM));
        break;

    case NodeType.QTFR:
        len = compileNonCECLengthQuantifierNode((QuantifierNode)node);
        break;

    case NodeType.ENCLOSE:
        len = compileLengthEncloseNode((EncloseNode)node);
        break;

    case NodeType.ANCHOR:
        len = compileLengthAnchorNode((AnchorNode)node);
        break;

    default:
        newInternalException(ERR_PARSER_BUG);

    } //switch
    return len;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:65,代码来源:ArrayCompiler.java

示例4: compileTree

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
protected final void compileTree(final Node node) {
    switch (node.getType()) {
    case NodeType.LIST:
        ConsAltNode lin = (ConsAltNode)node;
        do {
            compileTree(lin.car);
        } while ((lin = lin.cdr) != null);
        break;

    case NodeType.ALT:
        compileAltNode((ConsAltNode)node);
        break;

    case NodeType.STR:
        final StringNode sn = (StringNode)node;
        if (sn.isRaw()) {
            compileStringRawNode(sn);
        } else {
            compileStringNode(sn);
        }
        break;

    case NodeType.CCLASS:
        compileCClassNode((CClassNode)node);
        break;

    case NodeType.CANY:
        compileAnyCharNode();
        break;

    case NodeType.BREF:
        compileBackrefNode((BackRefNode)node);
        break;

    case NodeType.QTFR:
        compileNonCECQuantifierNode((QuantifierNode)node);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode enode = (EncloseNode)node;
        if (enode.isOption()) {
            compileOptionNode(enode);
        } else {
            compileEncloseNode(enode);
        }
        break;

    case NodeType.ANCHOR:
        compileAnchorNode((AnchorNode)node);
        break;

    default:
        // undefined node type
        newInternalException(ERR_PARSER_BUG);
    } // switch
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:57,代码来源:Compiler.java

示例5: compileLengthTree

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
private int compileLengthTree(Node node) {
    int len = 0;

    switch (node.getType()) {
    case NodeType.LIST:
        ConsAltNode lin = (ConsAltNode)node;
        do {
            len += compileLengthTree(lin.car);
        } while ((lin = lin.cdr) != null);
        break;

    case NodeType.ALT:
        ConsAltNode aln = (ConsAltNode)node;
        int n = 0;
        do {
            len += compileLengthTree(aln.car);
            n++;
        } while ((aln = aln.cdr) != null);
        len += (OPSize.PUSH + OPSize.JUMP) * (n - 1);
        break;

    case NodeType.STR:
        StringNode sn = (StringNode)node;
        if (sn.isRaw()) {
            len = compileLengthStringRawNode(sn);
        } else {
            len = compileLengthStringNode(sn);
        }
        break;

    case NodeType.CCLASS:
        len = compileLengthCClassNode((CClassNode)node);
        break;

    case NodeType.CTYPE:
    case NodeType.CANY:
        len = OPSize.OPCODE;
        break;

    case NodeType.BREF:
        BackRefNode br = (BackRefNode)node;

        len = ((!isIgnoreCase(regex.options) && br.backRef <= 2)
                ? OPSize.OPCODE : (OPSize.OPCODE + OPSize.MEMNUM));
        break;

    case NodeType.QTFR:
        len = compileNonCECLengthQuantifierNode((QuantifierNode)node);
        break;

    case NodeType.ENCLOSE:
        len = compileLengthEncloseNode((EncloseNode)node);
        break;

    case NodeType.ANCHOR:
        len = compileLengthAnchorNode((AnchorNode)node);
        break;

    default:
        newInternalException(ERR_PARSER_BUG);

    } //switch
    return len;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:65,代码来源:ArrayCompiler.java

示例6: compileTree

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
protected final void compileTree(Node node) {
    switch (node.getType()) {
    case NodeType.LIST:
        ConsAltNode lin = (ConsAltNode)node;
        do {
            compileTree(lin.car);
        } while ((lin = lin.cdr) != null);
        break;

    case NodeType.ALT:
        compileAltNode((ConsAltNode)node);
        break;

    case NodeType.STR:
        StringNode sn = (StringNode)node;
        if (sn.isRaw()) {
            compileStringRawNode(sn);
        } else {
            compileStringNode(sn);
        }
        break;

    case NodeType.CCLASS:
        compileCClassNode((CClassNode)node);
        break;

    case NodeType.CANY:
        compileAnyCharNode();
        break;

    case NodeType.BREF:
        compileBackrefNode((BackRefNode)node);
        break;

    case NodeType.QTFR:
        compileNonCECQuantifierNode((QuantifierNode)node);
        break;

    case NodeType.ENCLOSE:
        EncloseNode enode = (EncloseNode)node;
        if (enode.isOption()) {
            compileOptionNode(enode);
        } else {
            compileEncloseNode(enode);
        }
        break;

    case NodeType.ANCHOR:
        compileAnchorNode((AnchorNode)node);
        break;

    default:
        // undefined node type
        newInternalException(ERR_PARSER_BUG);
    } // switch
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:57,代码来源:Compiler.java

示例7: compileBackrefNode

import jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode; //导入依赖的package包/类
protected abstract void compileBackrefNode(BackRefNode node); 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:2,代码来源:Compiler.java


注:本文中的jdk.nashorn.internal.runtime.regexp.joni.ast.BackRefNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。