Declaration and references for a variable

Antonio Tancredi nazareno.tancredi at gmail.com
Tue Nov 13 15:27:09 PST 2012


Hi Jonathan,
thanks for the answer, it was really useful.
I tried the way that you suggested (I used JCTree.TreeScanner as base 
class for my visitor, just to avoid casts), using Trees and 
JavacElements and seems to work very well.
This is the result:

http://pastebin.com/NxjXTW6j

Please, let me know if I understood the concept.

Il 13/11/2012 22:14, Jonathan Gibbons ha scritto:
> What do you mean by "attribute phase"?   If you mean the "analyze" 
> call I mentioned earlier, that would be a bug.  If you mean the javac 
> internal phase "Attr", you won't see the "finished" method called 
> until "analyze" has completed, which is after the internal javac 
> phase, Flow.
>
> -- Jon
Sorry, I mean the "public Env<AttrContext> attribute(Env<AttrContext> 
env)" method inside com.sun.tools.javac.main.JavaCompiler.

Thanks,


Antonio Tancredi



More information about the compiler-dev mailing list