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


Java AccessNode类代码示例

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


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

示例1: enterAccessNode

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
@Override
public boolean enterAccessNode(final AccessNode accessNode) {
    enterDefault(accessNode);

    type("MemberExpression");
    comma();

    property("object");
    accessNode.getBase().accept(this);
    comma();

    property("property", accessNode.getProperty());
    comma();

    property("computed", false);

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

示例2: evaluateSafely

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private Object evaluateSafely(final Expression expr) {
    if (expr instanceof IdentNode) {
        return runtimeScope == null ? null : evaluatePropertySafely(runtimeScope, ((IdentNode)expr).getName());
    }

    if (expr instanceof AccessNode) {
        final AccessNode accessNode = (AccessNode)expr;
        final Object     base       = evaluateSafely(accessNode.getBase());
        if (!(base instanceof ScriptObject)) {
            return null;
        }
        return evaluatePropertySafely((ScriptObject)base, accessNode.getProperty());
    }

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

示例3: checkValidLValue

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private boolean checkValidLValue(final Expression init, final String contextString) {
    if (init instanceof IdentNode) {
        if (!checkIdentLValue((IdentNode)init)) {
            return false;
        }
        verifyIdent((IdentNode)init, contextString);
        return true;
    } else if (init instanceof AccessNode || init instanceof IndexNode) {
        return true;
    } else if (isDestructuringLhs(init)) {
        verifyDestructuringAssignmentPattern(init, contextString);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Parser.java

示例4: enterAccessNode

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
@Override
public boolean enterAccessNode(final AccessNode accessNode) {
    enterDefault(accessNode);

    type("MemberExpression");
    comma();

    property("object");
    accessNode.getBase().accept(this);
    comma();

    property("property");
    accessNode.getProperty().accept(this);
    comma();

    property("computed", false);

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

示例5: leaveASSIGN

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
@Override
public Node leaveASSIGN(final BinaryNode binaryNode) {
    final SpecializedNode specialized = specialize(binaryNode);
    final BinaryNode specBinaryNode = (BinaryNode)specialized.node;
    Type destType = specialized.type;
    if (destType == null) {
        destType = specBinaryNode.getType();
    }
    // Register assignments to this object in case this is used as constructor
    if (binaryNode.lhs() instanceof AccessNode) {
        AccessNode accessNode = (AccessNode) binaryNode.lhs();

        if (accessNode.getBase().getSymbol().isThis()) {
            lc.getCurrentFunction().addThisProperty(accessNode.getProperty().getName());
        }
    }
    return specBinaryNode.setRHS(convert(specBinaryNode.rhs(), destType));
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:19,代码来源:FinalizeTypes.java

示例6: getDefaultFunctionName

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private String getDefaultFunctionName() {
    if(!defaultNames.isEmpty()) {
        final Object nameExpr = defaultNames.peek();
        if(nameExpr instanceof PropertyKey) {
            markDefaultNameUsed();
            return ((PropertyKey)nameExpr).getPropertyName();
        } else if(nameExpr instanceof AccessNode) {
            markDefaultNameUsed();
            return ((AccessNode)nameExpr).getProperty();
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Parser.java

示例7: leaveASSIGN

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private Node leaveASSIGN(final BinaryNode binaryNode) {
    // If we're assigning a property of the this object ("this.foo = ..."), record it.
    final Expression lhs = binaryNode.lhs();
    if (lhs instanceof AccessNode) {
        final AccessNode accessNode = (AccessNode) lhs;
        final Expression base = accessNode.getBase();
        if (base instanceof IdentNode) {
            final Symbol symbol = ((IdentNode)base).getSymbol();
            if(symbol.isThis()) {
                thisProperties.peek().add(accessNode.getProperty());
            }
        }
    }
    return binaryNode;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:AssignSymbols.java

示例8: getDefaultFunctionName

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private String getDefaultFunctionName() {
    if (!defaultNames.isEmpty()) {
        final Object nameExpr = defaultNames.peek();
        if (nameExpr instanceof PropertyKey) {
            markDefaultNameUsed();
            return ((PropertyKey)nameExpr).getPropertyName();
        } else if (nameExpr instanceof AccessNode) {
            markDefaultNameUsed();
            return ((AccessNode)nameExpr).getProperty();
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:Parser.java

示例9: leaveASSIGN

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
private Node leaveASSIGN(final BinaryNode binaryNode) {
    // If we're assigning a property of the this object ("this.foo = ..."), record it.
    final Expression lhs = binaryNode.lhs();
    if (lhs instanceof AccessNode) {
        final AccessNode accessNode = (AccessNode) lhs;
        final Expression base = accessNode.getBase();
        if (base instanceof IdentNode) {
            final Symbol symbol = ((IdentNode) base).getSymbol();
            if (symbol.isThis()) {
                thisProperties.peek().add(accessNode.getProperty());
            }
        }
    }
    return binaryNode;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:16,代码来源:SymbolsResolver.java

示例10: verifyAssignment

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
/**
 * Verify an assignment expression.
 * @param op  Operation token.
 * @param lhs Left hand side expression.
 * @param rhs Right hand side expression.
 * @return Verified expression.
 */
private Expression verifyAssignment(final long op, final Expression lhs, final Expression rhs) {
    final TokenType opType = Token.descType(op);

    switch (opType) {
    case ASSIGN:
    case ASSIGN_ADD:
    case ASSIGN_BIT_AND:
    case ASSIGN_BIT_OR:
    case ASSIGN_BIT_XOR:
    case ASSIGN_DIV:
    case ASSIGN_MOD:
    case ASSIGN_MUL:
    case ASSIGN_SAR:
    case ASSIGN_SHL:
    case ASSIGN_SHR:
    case ASSIGN_SUB:
        if (!(lhs instanceof AccessNode ||
              lhs instanceof IndexNode ||
              lhs instanceof IdentNode)) {
            return referenceError(lhs, rhs, env._early_lvalue_error);
        }

        if (lhs instanceof IdentNode) {
            if (!checkIdentLValue((IdentNode)lhs)) {
                return referenceError(lhs, rhs, false);
            }
            verifyStrictIdent((IdentNode)lhs, "assignment");
        }
        break;

    default:
        break;
    }

    // Build up node.
    return new BinaryNode(op, lhs, rhs);
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:45,代码来源:Parser.java

示例11: leaveAccessNode

import jdk.nashorn.internal.ir.AccessNode; //导入依赖的package包/类
@Override
public Node leaveAccessNode(final AccessNode accessNode) {
    //While Object type is assigned here, Access Specialization in FinalizeTypes may narrow this, that
    //is why we can't set the access node base to be an object here, that will ruin access specialization
    //for example for a.x | 17.
    return end(ensureSymbol(Type.OBJECT, accessNode));
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:8,代码来源:Attr.java


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