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


Java UnaryNode.tokenType方法代码示例

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


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

示例1: branchOptimizer

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
private void branchOptimizer(final UnaryNode unaryNode, final Label label, final boolean state) {
    final Expression rhs = unaryNode.getExpression();

    switch (unaryNode.tokenType()) {
    case NOT:
        branchOptimizer(rhs, label, !state);
        return;
    default:
        if (unaryNode.getType().isBoolean()) {
            branchOptimizer(rhs, label, state);
            return;
        }
        break;
    }

    loadTestAndJump(unaryNode, label, state);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:BranchOptimizer.java

示例2: enterUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final boolean enterUnaryNode(final UnaryNode unaryNode) {
    switch (unaryNode.tokenType()) {
    case ADD:
        return enterADD(unaryNode);
    case BIT_NOT:
        return enterBIT_NOT(unaryNode);
    case DELETE:
        return enterDELETE(unaryNode);
    case NEW:
        return enterNEW(unaryNode);
    case NOT:
        return enterNOT(unaryNode);
    case SUB:
        return enterSUB(unaryNode);
    case TYPEOF:
        return enterTYPEOF(unaryNode);
    case VOID:
        return enterVOID(unaryNode);
    case DECPREFIX:
    case DECPOSTFIX:
    case INCPREFIX:
    case INCPOSTFIX:
        return enterDECINC(unaryNode);
    default:
        return super.enterUnaryNode(unaryNode);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:NodeOperatorVisitor.java

示例3: leaveUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final Node leaveUnaryNode(final UnaryNode unaryNode) {
    switch (unaryNode.tokenType()) {
    case ADD:
        return leaveADD(unaryNode);
    case BIT_NOT:
        return leaveBIT_NOT(unaryNode);
    case DELETE:
        return leaveDELETE(unaryNode);
    case NEW:
        return leaveNEW(unaryNode);
    case NOT:
        return leaveNOT(unaryNode);
    case SUB:
        return leaveSUB(unaryNode);
    case TYPEOF:
        return leaveTYPEOF(unaryNode);
    case VOID:
        return leaveVOID(unaryNode);
    case DECPREFIX:
    case DECPOSTFIX:
    case INCPREFIX:
    case INCPOSTFIX:
        return leaveDECINC(unaryNode);
    default:
        return super.leaveUnaryNode(unaryNode);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:NodeOperatorVisitor.java

示例4: leaveUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public Node leaveUnaryNode(final UnaryNode unaryNode) {
    if (unaryNode.isAssignment() && unaryNode.getExpression() instanceof IdentNode) {
        checkConstAssignment((IdentNode) unaryNode.getExpression());
    }
    switch (unaryNode.tokenType()) {
    case DELETE:
        return leaveDELETE(unaryNode);
    case TYPEOF:
        return leaveTYPEOF(unaryNode);
    default:
        return super.leaveUnaryNode(unaryNode);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:AssignSymbols.java

示例5: enterUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
    switch (unaryNode.tokenType()) {
    case POS:
        return enterPOS(unaryNode);
    case BIT_NOT:
        return enterBIT_NOT(unaryNode);
    case DELETE:
        return enterDELETE(unaryNode);
    case NEW:
        return enterNEW(unaryNode);
    case NOT:
        return enterNOT(unaryNode);
    case NEG:
        return enterNEG(unaryNode);
    case TYPEOF:
        return enterTYPEOF(unaryNode);
    case VOID:
        return enterVOID(unaryNode);
    case DECPREFIX:
    case DECPOSTFIX:
    case INCPREFIX:
    case INCPOSTFIX:
        return enterDECINC(unaryNode);
    default:
        return super.enterUnaryNode(unaryNode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:NodeOperatorVisitor.java

示例6: leaveUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final Node leaveUnaryNode(final UnaryNode unaryNode) {
    switch (unaryNode.tokenType()) {
    case POS:
        return leavePOS(unaryNode);
    case BIT_NOT:
        return leaveBIT_NOT(unaryNode);
    case DELETE:
        return leaveDELETE(unaryNode);
    case NEW:
        return leaveNEW(unaryNode);
    case NOT:
        return leaveNOT(unaryNode);
    case NEG:
        return leaveNEG(unaryNode);
    case TYPEOF:
        return leaveTYPEOF(unaryNode);
    case VOID:
        return leaveVOID(unaryNode);
    case DECPREFIX:
    case DECPOSTFIX:
    case INCPREFIX:
    case INCPOSTFIX:
        return leaveDECINC(unaryNode);
    default:
        return super.leaveUnaryNode(unaryNode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:NodeOperatorVisitor.java

示例7: leaveUnaryNode

import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public Node leaveUnaryNode(final UnaryNode unaryNode) {
    switch (unaryNode.tokenType()) {
    case DELETE:
        return leaveDELETE(unaryNode);
    case TYPEOF:
        return leaveTYPEOF(unaryNode);
    default:
        return super.leaveUnaryNode(unaryNode);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:AssignSymbols.java

示例8: enterUnaryNode

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

    final TokenType tokenType = unaryNode.tokenType();
    if (tokenType == TokenType.NEW) {
        type("NewExpression");
        comma();

        final CallNode callNode = (CallNode)unaryNode.getExpression();
        property("callee");
        callNode.getFunction().accept(this);
        comma();

        array("arguments", callNode.getArgs());
    } else {
        final String operator;
        final boolean prefix;
        switch (tokenType) {
        case INCPOSTFIX:
            prefix = false;
            operator = "++";
            break;
        case DECPOSTFIX:
            prefix = false;
            operator = "--";
            break;
        case INCPREFIX:
            operator = "++";
            prefix = true;
            break;
        case DECPREFIX:
            operator = "--";
            prefix = true;
            break;
        default:
            prefix = true;
            operator = tokenType.getName();
            break;
        }

        type(unaryNode.isAssignment()? "UpdateExpression" : "UnaryExpression");
        comma();

        property("operator", operator);
        comma();

        property("prefix", prefix);
        comma();

        property("argument");
        unaryNode.getExpression().accept(this);
    }

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


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