[antlr-interest] cleaned up sets (I hope)

mblp at mega.ist.utl.pt mblp at mega.ist.utl.pt
Fri Mar 30 06:50:05 PDT 2007


Hey,

I can't resist to ask if is there any generics support on the roadmap,
or antlr3 won't use generics at all to maintain java 1.4-
compatibility? :P

I haven't dug deep into antlr, but I can remember some spots where
generics would be more elegant:

public class CommonTreeAdaptor<T extrens CommonTree> (...)

public class SQLTreeAdaptor extends CommonTreeAdaptor<SQLTree> {
	public <SQLTree> create(Token payload) {
		return new SQLTree(payload);
	}
}

My guess is it should be only a matter of creating the appropriate
template for the antlr code generation engine :)

On 3/30/07, Terence Parr <parrt at cs.usfca.edu> wrote:
> Hi,
>
> I've worked really hard to clean up the way sets are implemented in
> ANTLR v3.  It was a major pain in the ass cleaning this up.  I added
> about 25 new unit tests and it passes all my examples-v3 stuff.
> Seems to do the right now.  The implementation is much better.  Will
> be much easier to maintain.
>
> Please grab the build and try it.
>
> http://www.antlr.org/download/build/antlr-03-29-2007.19.tar.gz
>
> Should have the necessary libs in antlr-03-29-2007.19/lib:
>
> 	antlr-03-29-2007.19.jar, stringtemplate-3.0.jar, antlr-2.7.7.jar
>
> Ter
>


More information about the antlr-interest mailing list