當前位置: 首頁>>代碼示例>>Java>>正文


Java Local類代碼示例

本文整理匯總了Java中polyglot.ast.Local的典型用法代碼示例。如果您正苦於以下問題:Java Local類的具體用法?Java Local怎麽用?Java Local使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Local類屬於polyglot.ast包,在下文中一共展示了Local類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: flowLocal

import polyglot.ast.Local; //導入依賴的package包/類
@Override
public Map<EdgeKey, VarContext<SecurityPolicy>> flowLocal(Local n,
		VarContext<SecurityPolicy> dfIn,
		FlowGraph<VarContext<SecurityPolicy>> graph,
		Peer<VarContext<SecurityPolicy>> peer) {
       dfIn = copyAndConstrain((IFConsContext)dfIn, peer, "local-no-top-condition");
   	
   	Map<EdgeKey, VarContext<SecurityPolicy>> ret = super.flowLocal(n, dfIn, graph, peer);

   	VarContext<SecurityPolicy> df = ret.values().iterator().next();
       SecurityPolicyVariable localVar = (SecurityPolicyVariable) df.getLocalAbsVal(n.name(), n.type());
   	
       factory.addConstraint(new NoTopConstraint(localVar, peer.node().position()));
   	
   	return ret;
}
 
開發者ID:HarvardPL,項目名稱:cryptoerase,代碼行數:17,代碼來源:CEDataFlow.java

示例2: exprToAccessPath

import polyglot.ast.Local; //導入依賴的package包/類
public AccessPath exprToAccessPath(Expr e) {
    if (e instanceof Local) {
        Local l = (Local) e;
        return exprToAccessPath(l);
    }
    else if (e instanceof Field) {
        Field f = (Field) e;
        CETypeSystem ts = (CETypeSystem) f.type().typeSystem();
        FieldInstance fi = f.fieldInstance();
        if (!fi.isCanonical()) {
            Goal g = ts.extensionInfo().scheduler().currentGoal();
            g.setUnreachableThisRun();
        }
        else if (!fi.type().equals(ts.Condition())) {
            throw new InternalCompilerError("Not a condition! ");
        }

        return new AccessPathField(fi, e.toString(), f.position());

    }
    throw new InternalCompilerError("Expression " + e
            + " not suitable for an access path.", e.position());
}
 
開發者ID:HarvardPL,項目名稱:cryptoerase,代碼行數:24,代碼來源:CESecurityPolicyFactory.java

示例3: leave

import polyglot.ast.Local; //導入依賴的package包/類
@Override
public Node leave(Node old, Node n, NodeVisitor v) {
	if (CEExt_c.ext(n).isConditionSet()) {
        // it's a set condition!
        Call c = (Call) n;
        if (c.target() instanceof Local) {
            // ignore local conditions, we're only interested in fields
        }
        else if (c.target() instanceof Field) {
            Field f = (Field) c.target();
            this.setConds.addAll(autil.abstractLocations(f));
        }
        else {
            throw new InternalCompilerError("Can't handle " + n);
        }
	}
	
	if (n instanceof Call) {
        process((Call) n);
    }
    else if (n instanceof New) {
        process((New) n);
    }
    else if (n instanceof ConstructorCall) {
        process((ConstructorCall) n);
    }
	
    return n;
}
 
開發者ID:HarvardPL,項目名稱:cryptoerase,代碼行數:30,代碼來源:SetConditionsVisitor.java


注:本文中的polyglot.ast.Local類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。