[antlr-interest] Multiple versions of Antlr playing nice together?

Jeremy Rayner jeremy.rayner at gmail.com
Fri Jul 1 10:20:23 PDT 2005


Hiya,
  To get round this issue in groovy, 
http://groovy.codehaus.org

we used the jarjar tool
http://tonicsystems.com/products/jarjar/

It can be called from Ant or Maven, and it can rename the
package, so that you don't clash.

For example this is our usage
http://cvs.codehaus.org/viewrep/groovy/groovy/groovy-core/maven.xml?r=1.124#l570

This renames all antlr.* references to groovyjarjarantlr.*
which is unlikely to clash with other versions of antlr in the same
container

cheers

jez.
On 7/1/05, Greg Lindholm <glindholm at yahoo.com> wrote:
> 
> 
> > From: Terence Parr <parrt at cs.usfca.edu>
> > Date: Thu, 30 Jun 2005 13:30:31 -0700
> >
> > > Are you doing anything to ensure that different (incompatable)
> > version
> > > of antlr can be used side-by-side in a project? I.e. Use different
> > > package names?
> >
> > I can't really do anything...the more common situation is to get an
> > updated version and expect your code to still compile.
> > antlr275.Token would be annoying, but is the only solution if you
> > must have multiple version :(
> >
> 
> Well... It's really only an issue when there is an incompatiblity.
> If you know a new release is incompatible with an older one you
> can change the package name or deprecate the old class and put the
> changes into a new class.
> 
> At this point I'm sure all your attention is on version 3 but going
> forward it's a good thing to keep in mind that multiple versions of
> antlr may have to run side-by-side in the same app.
> 
> 
> > > What about when Antlr 3.x come into widespread use? Will it be able
> > to
> > > be used in the same application with Antlr 2.x?
> >
> > Fortunately here we have org.antlr.* now instead of antlr.* so it
> > works fine.  Indeed 3 is written in 2.7.5 :)
> >
> 
> This is good to hear, you did use different package names.
> 
> 
> >
> > An example I just encountered is Struts 1.2.7 comes with Antlr 2.7.2
> > and Hibernate 3.0.5 comes with antlr-2.7.5H3.jar.
> > In this project I'm not doing any development with antlr I'm just a
> > "user" of Struts and Hibernate. And as a user I don't know if there
> > are
> > any dependencies on a particular version of antlr or even if these
> > two
> > are compatible.
> > If I use the later release 2.7.5H3 will it break something is Struts?
> 
> So does anyone know if there are any gotchas when upgrading from Antlr
> 2.7.2  to 2.7.5H3 (or the latest 2.7.x) release?
> 
> 
> 
> 
> ____________________________________________________
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
> http://football.fantasysports.yahoo.com
> 


-- 
http://javanicus.com/blog2


More information about the antlr-interest mailing list