Java Code Examples for jdk.nashorn.internal.runtime.regexp.joni.ast.Node#getType2Bit()

The following examples show how to use jdk.nashorn.internal.runtime.regexp.joni.ast.Node#getType2Bit() . 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: Analyser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private boolean checkTypeTree(Node node, int typeMask, int encloseMask, int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) return true;

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) return true;
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) return true;

        if (an.target != null) invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 2
Source File: Analyser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private boolean checkTypeTree(Node node, int typeMask, int encloseMask, int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) return true;

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) return true;
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) return true;

        if (an.target != null) invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 3
Source File: Analyser.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
private boolean checkTypeTree(Node node, int typeMask, int encloseMask, int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) return true;

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) return true;
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) return true;

        if (an.target != null) invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 4
Source File: Analyser.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 5
Source File: Analyser.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 6
Source File: Analyser.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 7
Source File: Analyser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 8
Source File: Analyser.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 9
Source File: Analyser.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}
 
Example 10
Source File: Analyser.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
private boolean checkTypeTree(final Node node, final int typeMask, final int encloseMask, final int anchorMask) {
    if ((node.getType2Bit() & typeMask) == 0) {
        return true;
    }

    boolean invalid = false;

    switch(node.getType()) {
    case NodeType.LIST:
    case NodeType.ALT:
        ConsAltNode can = (ConsAltNode)node;
        do {
            invalid = checkTypeTree(can.car, typeMask, encloseMask, anchorMask);
        } while (!invalid && (can = can.cdr) != null);
        break;

    case NodeType.QTFR:
        invalid = checkTypeTree(((QuantifierNode)node).target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ENCLOSE:
        final EncloseNode en = (EncloseNode)node;
        if ((en.type & encloseMask) == 0) {
            return true;
        }
        invalid = checkTypeTree(en.target, typeMask, encloseMask, anchorMask);
        break;

    case NodeType.ANCHOR:
        final AnchorNode an = (AnchorNode)node;
        if ((an.type & anchorMask) == 0) {
            return true;
        }

        if (an.target != null) {
            invalid = checkTypeTree(an.target, typeMask, encloseMask, anchorMask);
        }
        break;

    default:
        break;

    } // switch

    return invalid;
}