[JSR308] Javac Processor API

Niko Matsakis niko at alum.mit.edu
Fri Mar 2 01:57:43 EST 2007


> Your list of phases is incomplete.  Between parsing and annotation  
> processing, the symbol (element) table is built.  That is easy to  
> miss in the javac source, since the phase is internally called  
> "enter".  All class elements are created, along with member element  
> initializers which get invoked on demand.  Since all symbols have  
> types, those get created, too.  The model is "raw" at this point as  
> there has been no type checks run yet, so basically you have a good  
> model with compilable source code, but a flawed model if the source  
> has attribution-level failures.

Yes, I left out the Enter pass for simplicity, but it is important  
and so I should not have.  However, as I understand it, the Enter  
pass only derives information for the "interface" of a class: i.e.,  
the types of its fields, method parameters, and the like.  It does  
not look inside of a method, right?  Therefore, even if this pass has  
executed, attribute processors still will not know (for example)  
whether "foo.bar" represents a package, static field reference, etc.

Anyhow, most likely this issue is out of scope for JSR308, but I  
wanted to raise it in any case.


Niko



More information about the JSR308 mailing list