[antlr-interest] GCJ
Robert Colquhoun
rjc at trump.net.au
Sun Jul 13 19:19:32 PDT 2003
Hello,
At 04:00 PM 11/07/2003 +0200, Ric Klaren wrote:
>Hi,
>
>On Fri, Jul 11, 2003 at 11:47:49PM +1000, Robert Colquhoun wrote:
> > I need to fix the patch up first, gjc complained about some synchronization
> > in the antlr.collections.impl classes, i went overboard and removed the
> > Vector and Stack classes and replaced with java.util versions...
>
>Think those existed for some older java version not sure. But I still look
>forward to a patch.
It builds with lots of warnings but i have put a simple(2 line) patch to
build with gcj at:
http://www.trump.net.au/~rjc/antlr/
From scratch:
wget http://www.antlr.org/download/antlr-2.7.2.tar.gz
wget http://www.trump.net.au/~rjc/antlr/antlr-gcj.diff
tar xvfz antlr-2.7.2.tar.gz
cd antlr-2.7.2
patch -p1 < ../antlr-gcj.diff
find antlr -name '*.class' -exec rm {} \;
javac -classpath . antlr/build/*.java
javac -classpath . antlr/J*.java
java -classpath . antlr.build.Tool build
java -classpath . antlr.build.Tool jar
gcj -o antlr --main antlr.Tool antlr.jar
And there should be an executable called 'antlr' which runs antlr.Tool in
the current directory
>That's a stripped binary? If I make a redhat 9 rpm I hope it can use the
>redhat installed gcj.so, probably it's also possible to compile it
>staticaly (or only do gcj.so statically).
I am not sure but i think libgcj has a hidden bytecode interpreter
somewhere in the library for the dynamic java code generation and
loading...might not link statically very well without pulling in the whole
library.
> And what's 2.6 Mb nowadays ;)
>Advantage of using gcj is that it comes default nowadays with most linux
>distributions, this unlike java for which you have to dig around first.
>Also no classpath trouble. No trouble in figuring out you'd have to run
>antlr.Tool etc. It would also open the opportunity for distributions to
>ship antlr with/in place of pccts.
I also looked at the 2.7.2 configure/make/make install system - that
appears to have got out of step with the java antlr.build system. For
instance antlr.jar is only the runtime if built with configure/make but is
the whole lot if done with antlr.build
Also java source files are kind of different from C/C++ there are no
includes(making for a much faster compile) and dependencies can be very
complicated it might be better if the configure/make system just compiles
everything from scratch. This would also get rid of the 300k java_deps
file reducing download size.
ie What is faster compiling 100k lines of java files or parsing a 300k text
file figuring dependencies and stat'ing all the java source files then
finally getting around to compiling the resulting set plus crossing fingers
that java_deps is up to date and the one line java change you just made
hasn't destroyed the dependency tree.
- Robert
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list