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

Java ExpressionStatement类代码示例

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

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



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

示例1: getDirective

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
/**
 * Directive value or null if statement is not a directive.
 *
 * @param stmt Statement to be checked
 * @return Directive value if the given statement is a directive
 */
private String getDirective(final Node stmt) {
    if (stmt instanceof ExpressionStatement) {
        final Node expr = ((ExpressionStatement)stmt).getExpression();
        if (expr instanceof LiteralNode) {
            final LiteralNode<?> lit = (LiteralNode<?>)expr;
            final long litToken = lit.getToken();
            final TokenType tt = Token.descType(litToken);
            // A directive is either a string or an escape string
            if (tt == TokenType.STRING || tt == TokenType.ESCSTRING) {
                // Make sure that we don't unescape anything. Return as seen in source!
                return source.getString(lit.getStart(), Token.descLength(litToken));
            }
        }
    }

    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:Parser.java


示例2: enterExpressionStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
    // handle debugger statement
    final Node expression = expressionStatement.getExpression();
    if (expression instanceof RuntimeNode) {
        expression.accept(this);
        return false;
    }

    enterDefault(expressionStatement);

    type("ExpressionStatement");
    comma();

    property("expression");
    expression.accept(this);

    return leave();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:JSONWriter.java


示例3: leaveExpressionStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
    final Expression expr = expressionStatement.getExpression();
    ExpressionStatement node = expressionStatement;

    final FunctionNode currentFunction = lc.getCurrentFunction();

    if (currentFunction.isProgram()) {
        if (!isInternalExpression(expr) && !isEvalResultAssignment(expr)) {
            node = expressionStatement.setExpression(
                new BinaryNode(
                    Token.recast(
                        expressionStatement.getToken(),
                        TokenType.ASSIGN),
                    compilerConstant(RETURN),
                expr));
        }
    }

    return addStatement(node);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Lower.java


示例4: leaveBlock

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public Node leaveBlock(final Block block) {
    if (!artificialBlock) {
        if (lc.isFunctionBody()) {
            // Prepend declaration-only var statements to the top of the statement list.
            lc.prependStatements(getCurrentFunctionState().varStatements);
        } else if (lc.isSplitBody()) {
            appendSplitReturn(FALLTHROUGH_STATE, NO_LINE_NUMBER);
            if (getCurrentFunctionState().fn.isProgram()) {
                // If we're splitting the program, make sure every shard ends with "return :return" and
                // begins with ":return = :return-in;".
                lc.prependStatement(new ExpressionStatement(NO_LINE_NUMBER, NO_TOKEN, NO_FINISH,
                        new BinaryNode(Token.toDesc(TokenType.ASSIGN, 0, 0), createReturnIdent(), createReturnParamIdent())));
            }
        }
    }
    return block;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:SplitIntoFunctions.java


示例5: enterExpressionStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
    // handle debugger statement
    final Node expression = expressionStatement.getExpression();
    if (expression instanceof RuntimeNode) {
        assert false : "should not reach here: RuntimeNode";
        return false;
    }

    enterDefault(expressionStatement);

    type("ExpressionStatement");
    comma();

    property("expression");
    expression.accept(this);

    return leave();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:JSONWriter.java


示例6: leaveExpressionStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
    final Expression expr = expressionStatement.getExpression();
    ExpressionStatement node = expressionStatement;

    final FunctionNode currentFunction = lc.getCurrentFunction();

    if (currentFunction.isProgram()) {
        if (!isInternalExpression(expr) && !isEvalResultAssignment(expr)) {
            node = expressionStatement.setExpression(
                new BinaryNode(
                    Token.recast(
                        expressionStatement.getToken(),
                        TokenType.ASSIGN),
                    compilerConstant(RETURN),
                expr));
        }
    }

    if (es6 && expressionStatement.destructuringDeclarationType() != null) {
        throwNotImplementedYet("es6.destructuring", expressionStatement);
    }

    return addStatement(node);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:Lower.java


示例7: debuggerStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
/**
 * DebuggerStatement :
 *      debugger ;
 *
 * See 12.15
 *
 * Parse debugger statement.
 */
private void  debuggerStatement() {
    // Capture DEBUGGER token.
    final int  debuggerLine  = line;
    final long debuggerToken = token;
    // DEBUGGER tested in caller.
    next();
    endOfLine();
    appendStatement(new ExpressionStatement(debuggerLine, debuggerToken, finish, new RuntimeNode(debuggerToken, finish, RuntimeNode.Request.DEBUGGER, new ArrayList<Expression>())));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Parser.java


示例8: leaveVarNode

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public Node leaveVarNode(final VarNode varNode) {
    addStatement(varNode);
    if (varNode.getFlag(VarNode.IS_LAST_FUNCTION_DECLARATION) && lc.getCurrentFunction().isProgram()) {
        new ExpressionStatement(varNode.getLineNumber(), varNode.getToken(), varNode.getFinish(), new IdentNode(varNode.getName())).accept(this);
    }
    return varNode;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Lower.java


示例9: enterExpressionStatement

import jdk.nashorn.internal.ir.ExpressionStatement; //导入依赖的package包/类
@Override
public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
    final Expression expr = expressionStatement.getExpression();
    if(!expr.isSelfModifying()) {
        tagNeverOptimistic(expr);
    }
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:OptimisticTypesCalculator.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java TestLogger类代码示例发布时间:2022-05-22
下一篇:
Java IMapEntry类代码示例发布时间: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