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


Java SyntaxException类代码示例

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


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

示例1: setupLookBehind

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private Node setupLookBehind(final Node node) {
    final AnchorNode an = (AnchorNode)node;
    final int len = getCharLengthTree(an.target);
    switch (returnCode) {
    case 0:
        an.charLength = len;
        break;
    case GET_CHAR_LEN_VARLEN:
        throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
    case GET_CHAR_LEN_TOP_ALT_VARLEN:
        if (syntax.differentLengthAltLookBehind()) {
            return divideLookBehindAlternatives(node);
        }
        throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
    default:
        break;
    }
    return node;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:Analyser.java

示例2: setupLookBehind

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private Node setupLookBehind(Node node) {
    AnchorNode an = (AnchorNode)node;
    int len = getCharLengthTree(an.target);
    switch(returnCode) {
    case 0:
        an.charLength = len;
        break;
    case GET_CHAR_LEN_VARLEN:
        throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
    case GET_CHAR_LEN_TOP_ALT_VARLEN:
        if (syntax.differentLengthAltLookBehind()) {
            return divideLookBehindAlternatives(node);
        } else {
            throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
        }
    }
    return node;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:19,代码来源:Analyser.java

示例3: nextStateClass

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
public void nextStateClass(final CCStateArg arg, final ScanEnvironment env) {
    if (arg.state == CCSTATE.RANGE) {
        throw new SyntaxException(ErrorMessages.ERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE);
    }

    if (arg.state == CCSTATE.VALUE && arg.type != CCVALTYPE.CLASS) {
        if (arg.type == CCVALTYPE.SB) {
            bs.set(arg.vs);
        } else if (arg.type == CCVALTYPE.CODE_POINT) {
            addCodeRange(env, arg.vs, arg.vs);
        }
    }
    arg.state = CCSTATE.VALUE;
    arg.type = CCVALTYPE.CLASS;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:CClassNode.java

示例4: parseExpRepeat

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private Node parseExpRepeat(final Node targetp, final boolean group) {
    Node target = targetp;
    while (token.type == TokenType.OP_REPEAT || token.type == TokenType.INTERVAL) { // repeat:
        if (target.isInvalidQuantifier()) {
            throw new SyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
        }

        final QuantifierNode qtfr = new QuantifierNode(token.getRepeatLower(),
                                                 token.getRepeatUpper(),
                                                 token.type == TokenType.INTERVAL);

        qtfr.greedy = token.getRepeatGreedy();
        final int ret = qtfr.setQuantifier(target, group, env, chars, getBegin(), getEnd());
        Node qn = qtfr;

        if (token.getRepeatPossessive()) {
            final EncloseNode en = new EncloseNode(EncloseType.STOP_BACKTRACK); // node_new_enclose
            en.setTarget(qn);
            qn = en;
        }

        if (ret == 0) {
            target = qn;
        } else if (ret == 2) { /* split case: /abc+/ */
            target = ConsAltNode.newListNode(target, null);
            final ConsAltNode tmp = ((ConsAltNode)target).setCdr(ConsAltNode.newListNode(qn, null));

            fetchToken();
            return parseExpRepeatForCar(target, tmp, group);
        }
        fetchToken(); // goto re_entry
    }
    return target;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:Parser.java

示例5: invalidRangeQuantifier

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private int invalidRangeQuantifier(final boolean synAllow) {
    if (synAllow) {
        restore();
        return 1;
    }
    throw new SyntaxException(ERR_INVALID_REPEAT_RANGE_PATTERN);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Lexer.java

示例6: fetchEscapedValueControl

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private void fetchEscapedValueControl() {
    if (!left()) {
        throw new SyntaxException(ERR_END_PATTERN_AT_CONTROL);
    }
    fetch();
    if (c == '?') {
        c = 0177;
    } else {
        if (c == syntax.metaCharTable.esc) {
            c = fetchEscapedValue();
        }
        c &= 0x9f;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:Lexer.java

示例7: nextStateClass

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
public void nextStateClass(CCStateArg arg, ScanEnvironment env) {
    if (arg.state == CCSTATE.RANGE) throw new SyntaxException(ErrorMessages.ERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE);

    if (arg.state == CCSTATE.VALUE && arg.type != CCVALTYPE.CLASS) {
        if (arg.type == CCVALTYPE.SB) {
            bs.set(arg.vs);
        } else if (arg.type == CCVALTYPE.CODE_POINT) {
            addCodeRange(env, arg.vs, arg.vs);
        }
    }
    arg.state = CCSTATE.VALUE;
    arg.type = CCVALTYPE.CLASS;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:14,代码来源:CClassNode.java

示例8: parseExpRepeat

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException; //导入依赖的package包/类
private Node parseExpRepeat(Node target, boolean group) {
    while (token.type == TokenType.OP_REPEAT || token.type == TokenType.INTERVAL) { // repeat:
        if (target.isInvalidQuantifier()) {
            throw new SyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
        }

        QuantifierNode qtfr = new QuantifierNode(token.getRepeatLower(),
                                                 token.getRepeatUpper(),
                                                 token.type == TokenType.INTERVAL);

        qtfr.greedy = token.getRepeatGreedy();
        int ret = qtfr.setQuantifier(target, group, env, chars, getBegin(), getEnd());
        Node qn = qtfr;

        if (token.getRepeatPossessive()) {
            EncloseNode en = new EncloseNode(EncloseType.STOP_BACKTRACK); // node_new_enclose
            en.setTarget(qn);
            qn = en;
        }

        if (ret == 0) {
            target = qn;
        } else if (ret == 2) { /* split case: /abc+/ */
            target = ConsAltNode.newListNode(target, null);
            ConsAltNode tmp = ((ConsAltNode)target).setCdr(ConsAltNode.newListNode(qn, null));

            fetchToken();
            return parseExpRepeatForCar(target, tmp, group);
        }
        fetchToken(); // goto re_entry
    }
    return target;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:34,代码来源:Parser.java


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