• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TokenType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parseExpTkByte

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private Node parseExpTkByte(final boolean group) {
    final StringNode node = new StringNode(chars, token.backP, p); // tk_byte:
    while (true) {
        fetchToken();
        if (token.type != TokenType.STRING) {
            break;
        }

        if (token.backP == node.end) {
            node.end = p; // non escaped character, remain shared, just increase shared range
        } else {
            node.cat(chars, token.backP, p); // non continuous string stream, need to COW
        }
    }
    // targetp = node;
    return parseExpRepeat(node, group); // string_end:, goto repeat
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Parser.java


示例2: parseBranch

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private Node parseBranch(final TokenType term) {
    Node node = parseExp(term);

    if (token.type == TokenType.EOT || token.type == term || token.type == TokenType.ALT) {
        return node;
    }
    final ConsAltNode top = ConsAltNode.newListNode(node, null);
    ConsAltNode t = top;

    while (token.type != TokenType.EOT && token.type != term && token.type != TokenType.ALT) {
        node = parseExp(term);
        if (node.getType() == NodeType.LIST) {
            t.setCdr((ConsAltNode)node);
            while (((ConsAltNode)node).cdr != null ) {
                node = ((ConsAltNode)node).cdr;
            }

            t = ((ConsAltNode)node);
        } else {
            t.setCdr(ConsAltNode.newListNode(node, null));
            t = t.cdr;
        }
    }
    return top;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Parser.java


示例3: parseSubExp

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private Node parseSubExp(final TokenType term) {
    Node node = parseBranch(term);

    if (token.type == term) {
        return node;
    } else if (token.type == TokenType.ALT) {
        final ConsAltNode top = ConsAltNode.newAltNode(node, null);
        ConsAltNode t = top;
        while (token.type == TokenType.ALT) {
            fetchToken();
            node = parseBranch(term);

            t.setCdr(ConsAltNode.newAltNode(node, null));
            t = t.cdr;
        }

        if (token.type != term) {
            parseSubExpError(term);
        }
        return top;
    } else {
        parseSubExpError(term);
        return null; //not reached
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Parser.java


示例4: fetchTokenInCCFor_u

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private void fetchTokenInCCFor_u() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) {  /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Lexer.java


示例5: fetchTokenFor_uHex

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private void fetchTokenFor_uHex() {
    if (!left()) {
        return;
    }
    final int last = p;

    if (syntax.op2EscUHex4()) {
        int num = scanUnsignedHexadecimalNumber(4);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.CODE_POINT;
        token.setCode(num);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Lexer.java


示例6: fetchTokenFor_digit

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private void fetchTokenFor_digit() {
    unfetch();
    final int last = p;
    final int num = scanUnsignedNumber();
    if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
    } else if (syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
        if (syntax.strictCheckBackref()) {
            if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
                throw new ValueException(ERR_INVALID_BACKREF);
            }
        }
        token.type = TokenType.BACKREF;
        token.setBackrefRef(num);
        return;
    }

    if (c == '8' || c == '9') { /* normal char */ // skip_backref:
        p = last;
        inc();
        return;
    }
    p = last;

    fetchTokenFor_zero(); /* fall through */
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Lexer.java


示例7: fetchTokenFor_zero

import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType; //导入依赖的package包/类
private void fetchTokenFor_zero() {
    if (syntax.opEscOctal3()) {
        final int last = p;
        int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
        if (num < 0) {
            throw new ValueException(ERR_TOO_BIG_NUMBER);
        }
        if (p == last) { /* can't read nothing. */
            num = 0; /* but, it's not error */
        }
        token.type = TokenType.RAW_BYTE;
        token.setC(num);
    } else if (c != '0') {
        inc();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Lexer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleForwardingListenableFuture类代码示例发布时间:2022-05-22
下一篇:
Java OFStatsReplyFlagsSerializerVer14类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap