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


Java ReturnNode.getExpression方法代码示例

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


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

示例1: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    enterDefault(returnNode);

    type("ReturnStatement");
    comma();

    final Node arg = returnNode.getExpression();
    property("argument");
    if (arg != null) {
        arg.accept(this);
    } else {
        nullValue();
    }

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

示例2: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExpr.accept(this);
        returnExprType = getType(returnExpr);
    } else {
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:LocalVariableTypesCalculator.java

示例3: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!method.isReachable()) {
        return false;
    }
    enterStatement(returnNode);

    method.registerReturn();

    final Type returnType = lc.getCurrentFunction().getReturnType();

    final Expression expression = returnNode.getExpression();
    if (expression != null) {
        loadExpressionUnbounded(expression);
    } else {
        method.loadUndefined(returnType);
    }

    method._return(returnType);

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:CodeGenerator.java

示例4: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
    } else {
        assertTypeStackIsEmpty();
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:LocalVariableTypesCalculator.java

示例5: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!method.isReachable()) {
        return false;
    }
    enterStatement(returnNode);

    final Type returnType = lc.getCurrentFunction().getReturnType();

    final Expression expression = returnNode.getExpression();
    if (expression != null) {
        loadExpressionUnbounded(expression);
    } else {
        method.loadUndefined(returnType);
    }

    method._return(returnType);

    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:CodeGenerator.java

示例6: leaveReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public Node leaveReturnNode(final ReturnNode returnNode) {
    final Expression expr = returnNode.getExpression();
    final Type returnType;

    if (expr != null) {
        //we can't do parameter specialization if we return something that hasn't been typed yet
        final Symbol symbol = expr.getSymbol();
        if (expr.getType().isUnknown() && symbol.isParam()) {
            symbol.setType(Type.OBJECT);
        }

        returnType = widestReturnType(returnTypes.pop(), symbol.getSymbolType());
    } else {
        returnType = Type.OBJECT; //undefined
    }
    LOG.info("Returntype is now ", returnType);
    returnTypes.push(returnType);

    end(returnNode);

    return returnNode;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:24,代码来源:Attr.java

示例7: enterReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    lineNumber(returnNode);

    method.registerReturn();

    final Type returnType = lc.getCurrentFunction().getReturnType();

    final Expression expression = returnNode.getExpression();
    if (expression != null) {
        load(expression);
    } else {
        method.loadUndefined(returnType);
    }

    method._return(returnType);

    return false;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:20,代码来源:CodeGenerator.java

示例8: leaveReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public Node leaveReturnNode(final ReturnNode returnNode) {
    final Expression expr = returnNode.getExpression();
    final Type returnType;

    if (expr != null) {
        //we can't do parameter specialization if we return something that hasn't been typed yet
        final Symbol symbol = expr.getSymbol();
        if (expr.getType().isUnknown() && symbol.isParam()) {
            symbol.setType(Type.OBJECT);
        }

        returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType());
    } else {
        returnType = Type.OBJECT; //undefined
    }
    LOG.info("Returntype is now ", returnType);
    returnTypes.push(returnType);

    end(returnNode);

    return returnNode;
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:24,代码来源:Attr.java

示例9: leaveReturnNode

import jdk.nashorn.internal.ir.ReturnNode; //导入方法依赖的package包/类
@Override
public Node leaveReturnNode(final ReturnNode returnNode) {
    final Expression expr = returnNode.getExpression();
    if (expr != null) {
        return returnNode.setExpression(convert(expr, lc.getCurrentFunction().getReturnType()));
    }
    return returnNode;
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:9,代码来源:FinalizeTypes.java


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