[antlr-interest] Java Grammar

Gavin Lambert antlr at mirality.co.nz
Sun Nov 23 11:49:43 PST 2008


At 08:11 24/11/2008, Simon wrote:
 >But I've just realized that without access to the referenced
 >classes (source or binary form) it is still not possible to
 >do that.
 >
 >  a.b.c.D.X.z()
 >
 >Where does the class name end and the field access start?
 >There is simply no way to answer that question without
 >access to the classes.

Well, I've noticed that normally Java namespaces tend to have a 
lowercase initial letter, while classes have an uppercase initial 
letter.  Is that actually a requirement of the language or is it 
just a convention?  If it's a requirement then you should be able 
to use that as a hint :)

Otherwise, you're right, you'll need access to the classes.  But 
you'd need that anyway if you want to verify that the 
classes/members being used actually exist (as javac does).



More information about the antlr-interest mailing list