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


Java WhileNode.setFinish方法代码示例

本文整理汇总了Java中jdk.nashorn.internal.ir.WhileNode.setFinish方法的典型用法代码示例。如果您正苦于以下问题:Java WhileNode.setFinish方法的具体用法?Java WhileNode.setFinish怎么用?Java WhileNode.setFinish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.nashorn.internal.ir.WhileNode的用法示例。


在下文中一共展示了WhileNode.setFinish方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doStatement

import jdk.nashorn.internal.ir.WhileNode; //导入方法依赖的package包/类
/**
 * ...IterationStatement :
 *           ...
 *           do Statement while( Expression ) ;
 *           ...
 *
 * See 12.6
 *
 * Parse DO WHILE statement.
 */
private void doStatement() {
    // Capture DO token.
    final long doToken = token;
    // DO tested in the caller.
    next();

    WhileNode doWhileNode = new WhileNode(-1, doToken, Token.descPosition(doToken), true);
    lc.push(doWhileNode);

    try {
       // Get DO body.
        final Block body = getStatement();

        expect(WHILE);
        expect(LPAREN);
        final int doLine = line;
        final JoinPredecessorExpression test = joinPredecessorExpression();
        expect(RPAREN);

        if (type == SEMICOLON) {
            endOfLine();
        }
        doWhileNode.setFinish(finish);

        //line number is last
        appendStatement(doWhileNode =
            new WhileNode(doLine, doToken, finish, true).
                setBody(lc, body).
                setTest(lc, test));
    } finally {
        lc.pop(doWhileNode);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:Parser.java

示例2: doStatement

import jdk.nashorn.internal.ir.WhileNode; //导入方法依赖的package包/类
/**
 * ...IterationStatement :
 *           ...
 *           do Statement while( Expression ) ;
 *           ...
 *
 * See 12.6
 *
 * Parse DO WHILE statement.
 */
private void doStatement() {
    // Capture DO token.
    final long doToken = token;
    // DO tested in the caller.
    next();

    WhileNode doWhileNode = new WhileNode(-1, doToken, Token.descPosition(doToken), true);
    lc.push(doWhileNode);

    try {
       // Get DO body.
        final Block body = getStatement();

        expect(WHILE);
        expect(LPAREN);
        final int doLine = line;
        final Expression test = expression();
        expect(RPAREN);

        if (type == SEMICOLON) {
            endOfLine();
        }
        doWhileNode.setFinish(finish);

        //line number is last
        appendStatement(doWhileNode =
            new WhileNode(doLine, doToken, finish, true).
                setBody(lc, body).
                setTest(lc, test));
    } finally {
        lc.pop(doWhileNode);
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:44,代码来源:Parser.java

示例3: doStatement

import jdk.nashorn.internal.ir.WhileNode; //导入方法依赖的package包/类
/**
 * ...IterationStatement :
 *           ...
 *           do Statement while( Expression ) ;
 *           ...
 *
 * See 12.6
 *
 * Parse DO WHILE statement.
 */
private void doStatement() {
    // Capture DO token.
    final int  doLine  = line;
    final long doToken = token;
    // DO tested in the caller.
    next();

    WhileNode doWhileNode = new WhileNode(doLine, doToken, Token.descPosition(doToken), true);
    lc.push(doWhileNode);

    try {
       // Get DO body.
        doWhileNode = doWhileNode.setBody(lc, getStatement());

        expect(WHILE);
        expect(LPAREN);
        doWhileNode = doWhileNode.setTest(lc, expression());
        expect(RPAREN);

        if (type == SEMICOLON) {
            endOfLine();
        }
        doWhileNode.setFinish(finish);
        appendStatement(doWhileNode);
    } finally {
        lc.pop(doWhileNode);
    }
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:39,代码来源:Parser.java


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