本文整理汇总了Java中com.sun.tools.javac.tree.TreeCopier类的典型用法代码示例。如果您正苦于以下问题:Java TreeCopier类的具体用法?Java TreeCopier怎么用?Java TreeCopier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeCopier类属于com.sun.tools.javac.tree包,在下文中一共展示了TreeCopier类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitReference
import com.sun.tools.javac.tree.TreeCopier; //导入依赖的package包/类
@Override
public void visitReference(JCMemberReference tree) {
//perform arity-based check
Env<AttrContext> localEnv = env.dup(tree);
JCExpression exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
attr.memberReferenceQualifierResult(tree));
JCMemberReference mref2 = new TreeCopier<Void>(attr.make).copy(tree);
mref2.expr = exprTree;
Symbol lhsSym = TreeInfo.symbol(exprTree);
localEnv.info.selectSuper = lhsSym != null && lhsSym.name == lhsSym.name.table.names._super;
Symbol res =
attr.rs.getMemberReference(tree, localEnv, mref2,
exprTree.type, tree.name);
if (!res.kind.isResolutionError()) {
tree.sym = res;
}
if (res.kind.isResolutionTargetError() ||
res.type != null && res.type.hasTag(FORALL) ||
(res.flags() & Flags.VARARGS) != 0 ||
(TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
exprTree.type.isRaw() && !exprTree.type.hasTag(ARRAY))) {
tree.overloadKind = JCMemberReference.OverloadKind.OVERLOADED;
} else {
tree.overloadKind = JCMemberReference.OverloadKind.UNOVERLOADED;
}
//return a plain old deferred type for this
setResult(tree, deferredAttr.new DeferredType(tree, env));
}
示例2: provideTreeCopier
import com.sun.tools.javac.tree.TreeCopier; //导入依赖的package包/类
@Provides @Singleton
static TreeCopier<Void> provideTreeCopier(final TreeMaker treeMaker) {
return new TreeCopier<Void>(treeMaker);
}