Java Code Examples for jdk.nashorn.internal.runtime.regexp.joni.Config#VANILLA

The following examples show how to use jdk.nashorn.internal.runtime.regexp.joni.Config#VANILLA . 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: Node.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) return false;

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) return false;
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) return true;
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 2
Source File: Node.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) return false;

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) return false;
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) return true;
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 3
Source File: Node.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) return false;

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) return false;
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) return true;
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 4
Source File: CClassNode.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 5
Source File: Node.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 6
Source File: CClassNode.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 7
Source File: Node.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 8
Source File: CClassNode.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 9
Source File: Node.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 10
Source File: CClassNode.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 11
Source File: Node.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 12
Source File: CClassNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 13
Source File: Node.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 14
Source File: CClassNode.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 15
Source File: Node.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}
 
Example 16
Source File: CClassNode.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addCTypeByRange(final int ct, final boolean not, final int sbOut, final int mbr[]) {
    final int n = mbr[0];

    if (!not) {
        for (int i=0; i<n; i++) {
            for (int j=mbr[i * 2 + 1]; j<=mbr[i * 2 + 2]; j++) {
                if (j >= sbOut) {
                    if (Config.VANILLA) {
                        if (j == mbr[i * 2 + 2]) {
                            i++;
                        } else if (j > mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    } else {
                        if (j >= mbr[i * 2 + 1]) {
                            addCodeRangeToBuf(j, mbr[i * 2 + 2]);
                            i++;
                        }
                    }
                    // !goto sb_end!, remove duplication!
                    for (; i<n; i++) {
                        addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
                    }
                    return;
                }
                bs.set(j);
            }
        }
        // !sb_end:!
        for (int i=0; i<n; i++) {
            addCodeRangeToBuf(mbr[2 * i + 1], mbr[2 * i + 2]);
        }

    } else {
        int prev = 0;

        for (int i=0; i<n; i++) {
            for (int j=prev; j < mbr[2 * i + 1]; j++) {
                if (j >= sbOut) {
                    // !goto sb_end2!, remove duplication
                    prev = sbOut;
                    for (i=0; i<n; i++) {
                        if (prev < mbr[2 * i + 1]) {
                            addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
                        }
                        prev = mbr[i * 2 + 2] + 1;
                    }
                    if (prev < 0x7fffffff/*!!!*/) {
                        addCodeRangeToBuf(prev, 0x7fffffff);
                    }
                    return;
                }
                bs.set(j);
            }
            prev = mbr[2 * i + 2] + 1;
        }

        for (int j=prev; j<sbOut; j++) {
            bs.set(j);
        }

        // !sb_end2:!
        prev = sbOut;
        for (int i=0; i<n; i++) {
            if (prev < mbr[2 * i + 1]) {
                addCodeRangeToBuf(prev, mbr[i * 2 + 1] - 1);
            }
            prev = mbr[i * 2 + 2] + 1;
        }
        if (prev < 0x7fffffff/*!!!*/) {
            addCodeRangeToBuf(prev, 0x7fffffff);
        }
    }
}
 
Example 17
Source File: Node.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public final boolean isInvalidQuantifier() {
    if (!Config.VANILLA) {
        return false;
    }

    ConsAltNode node;

    switch(getType()) {

    case ANCHOR:
        return true;

    case ENCLOSE:
        /* allow enclosed elements */
        /* return is_invalid_quantifier_target(NENCLOSE(node)->target); */
        break;

    case LIST:
        node = (ConsAltNode)this;
        do {
            if (!node.car.isInvalidQuantifier()) {
                return false;
            }
        } while ((node = node.cdr) != null);
        return false;

    case ALT:
        node = (ConsAltNode)this;
        do {
            if (node.car.isInvalidQuantifier()) {
                return true;
            }
        } while ((node = node.cdr) != null);
        break;

    default:
        break;
    }

    return false;
}