[antlr-interest] Lexer and Parser class packaging

Randall R Schulz rschulz at sonic.net
Tue Jan 30 15:46:09 PST 2007


Vadim,

On Tuesday 30 January 2007 15:14, Vadim Tropashko wrote:
> As a general rule default packaging in java doest't
> work (or rather gives you such a headache that you'll
> never use default pakages). Therefore it is a good
> idea to wrap grammar file into a package.

It (the default package) works as specified, but the name "default" is 
poorly chosen. It's really anonymous, and as such, its constituent 
classes cannot be referenced in any import statement. Its classes can 
only be seen from other classes in the default (really anonymous) 
package.

But you're right, it's a headache and both the lexer and the parser need 
to be put in a named package to be useful anywhere other than in 
classes in the default (anonymous) package.


Randall Schulz


More information about the antlr-interest mailing list