【发布时间】:2011-05-02 04:15:18
【问题描述】:
正如我几天前在官方 Java 支持论坛上发布的那样,我想知道 JCTree Symbols 是否可以使用原始 javac 实现从自己的代码中解析出来。
http://forums.oracle.com/forums/thread.jspa?threadID=1774807&tstart=0
JCMethodInvocation object1 = (JCMethodInvocation) objectRef.ref;
解析resolve = Resolve.instance(javacTaskImpl.getContext());
ListBuffer<Type> argtypeListBuffer = new ListBuffer<Type>();
AttrContext attrContext = new AttrContext();
Env<AttrContext> env = new Env<AttrContext>((JCTree) objectRef.ref, attrContext);
System.out.println(type);
System.out.println(type.tsym);
resolve.resolveInternalMethod(object1.pos(), env, type, name, argtypeListBuffer.toList(), null);`
【问题讨论】:
标签: java javac symbols abstract-syntax-tree