本文整理汇总了Java中polyglot.ast.Field类的典型用法代码示例。如果您正苦于以下问题:Java Field类的具体用法?Java Field怎么用?Java Field使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Field类属于polyglot.ast包,在下文中一共展示了Field类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exprToAccessPath
import polyglot.ast.Field; //导入依赖的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());
}
示例2: leave
import polyglot.ast.Field; //导入依赖的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;
}
示例3: loadField
import polyglot.ast.Field; //导入依赖的package包/类
@Override
protected SecurityPolicy loadField(VarContext<SecurityPolicy> dfIn, Field n) {
CEFieldInstance fi = (CEFieldInstance) n.fieldInstance();
return fieldInstancePolicy(fi);
}