JavacTask.parse()的Javac AST符号解析
正如我几天前在官方Java支持论坛上发布的那样,我想知道,JCTree符号是否可以通过原始javac实现从自己的代码中解析出来 Resolve=Resolve.instance(javactasquimpl.getContext())JavacTask.parse()的Javac AST符号解析,java,javac,symbols,abstract-syntax-tree,Java,Javac,Symbols,Abstract Syntax Tree,正如我几天前在官方Java支持论坛上发布的那样,我想知道,JCTree符号是否可以通过原始javac实现从自己的代码中解析出来 Resolve=Resolve.instance(javactasquimpl.getContext()) ListBuffer argtypeListBuffer=newlistbuffer(); AttrContext AttrContext=新的AttrContext(); Env Env=new Env((JCTree)objectRef.ref,attrCo
ListBuffer argtypeListBuffer=newlistbuffer();
AttrContext AttrContext=新的AttrContext();
Env Env=new Env((JCTree)objectRef.ref,attrContext);
系统输出打印项次(类型);
System.out.println(type.tsym);
resolve.resolveInternalMethod(object1.pos(),env,type,name,argtypeListBuffer.toList(),null)`
我建议您调查com.sun.tools.javac.main.JavaCompiler如何进行符号解析。我想它在树里面(列表)
此外,您可能对projects和projectlombok.org感兴趣
JCMethodInvocation object1 = (JCMethodInvocation) objectRef.ref;
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);`