[antlr-interest] GCJ
paul taney
paultaney at yahoo.com
Thu Jul 10 17:05:40 PDT 2003
Loring,
You're too kind.
I have put the --classpath back into the script
and added this to that path:
/usr/local/gcc/gcc-3.3/libjava/java/lang
because that's were gcc's Throwable lives. And
added ".o" to the -o arg (because it complained
that antlr was a dir).
Now the compile script is:
gcj --classpath $CLASSPATHGNU -o antlr.o --main=Tool \
antlr/*.java \
antlr/actions/cpp/*.java \
antlr/actions/csharp/*.java \
antlr/actions/java/*.java \
antlr/build/*.java \
antlr/collections/*.java \
antlr/collections/impl/*.java \
antlr/debug/*.java \
antlr/preprocessor/*.java
Still we have:
/tmp/ccfeKrb0.o: In function
`antlr::ANTLRError::ANTLRError(void)':
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x44):
undefined reference to
`java::lang::Throwable::getCause(void)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x48):
undefined reference to
`java::lang::Throwable::initCause(java::lang::Throwable
*)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x5c):
undefined reference to
`java::lang::Throwable::getStackTrace(void)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x60):
undefined reference to
`java::lang::Throwable::setStackTrace(JArray<java::lang::StackTraceElement
*> *)'
<snip>
$ grep getCause $PATH/Throwable.java
public Throwable getCause()
* Then if <code>getCause()</code> doesn't return
null it adds a line
Throwable cause = getCause();
cause = cause.getCause();
Anybody have a clue?
paul
--- lgcraymer <lgc at mail1.jpl.nasa.gov> wrote:
> All--
>
> Since Paul and I took this discussion offline (my
> role has been
> mostly to interpret the compiler error messages
> while he does all the
> real work), he has made some impressive progress.
> After adding a few
> type casts to the ANTLR source, all of ANTLR
> compiles and we appear to
> be down to one link error--java.lang.Throwable
> methods cannot be
> found.
>
> At this point, our best guess is that this is fixed
> in the version of
> gcj used by RHUG
> (<http://sources.redhat.com/rhug/>--they call for a
> recent development snapshot) to get all of their
> Java projects to
> compile (some of which are more demanding than
> ANTLR). Unfortunately,
> Paul is stuck with a slow connection and has a
> family emergency to
> attend to, and I'm spending my spare time trying to
> prepare for this
> weekend's discussions. We won't be able to take the
> last small steps
> for several days. If anyone out there wants to
> produce an executable
> sooner, you have our blessings. I'll post his diffs
> and compilation
> script (neither of us have yet looked into gcj
> makefiles) below.
>
> --Loring
>
>
=================================================================
> File diffs:
> $ diff backup2/CppCodeGenerator.java
> CppCodeGenerator.java
> 97c97
> < charFormatter =
> (antlr.CharFormatter) new
> CppCharFormatter();
> ---
> > charFormatter = new
> CppCharFormatter();
> $ diff backup2/CSharpCodeGenerator.java
> CSharpCodeGenerator.java
> 3841,3842c3841
> < antlr.actions.csharp.ActionLexer lexer
> =
> new antlr.actions.csharp.ActionLexer(actionStr,
> <
>
> currentRule, this, tInfo);
> ---
> > antlr.actions.csharp.ActionLexer lexer
> =
> new antlr.actions.csharp.ActionLexer(actionStr,
> currentRule, this, tInfo);
> $ diff backup2/DiagnosticCodeGenerator.java
> DiagnosticCodeGenerator.java
> 33c33
> < charFormatter = (antlr.CharFormatter) new
> JavaCharFormatter();
> ---
> > charFormatter = new JavaCharFormatter();
> $ diff backup2/DocBookCodeGenerator.java
> DocBookCodeGenerator.java
> 40c40
> < charFormatter = (antlr.CharFormatter) new
> JavaCharFormatter();
> ---
> > charFormatter = new JavaCharFormatter();
> $ diff backup2/HTMLCodeGenerator.java
> HTMLCodeGenerator.java
> 37c37
> < charFormatter = (antlr.CharFormatter) new
> JavaCharFormatter();
> ---
> > charFormatter = new JavaCharFormatter();
> $ diff backup2/JavaCodeGenerator.java
> JavaCodeGenerator.java
> 77c77
> < charFormatter = (antlr.CharFormatter) new
> JavaCharFormatter();
> ---
> > charFormatter = new JavaCharFormatter();
>
>
===========================================================
> Compilation script:
> gcj --classpath $CLASSPATHGNU -o antlr.o --main=Tool
\
> antlr/*.java \
> antlr/actions/cpp/*.java \
> antlr/actions/csharp/*.java \
> antlr/actions/java/*.java \
> antlr/build/*.java \
> antlr/collections/*.java \
> antlr/collections/impl/*.java \
> antlr/debug/*.java \
> antlr/preprocessor/*.java
>
>
============================================================
>
> --- In antlr-interest at yahoogroups.com, paul taney
> <paultaney at y...>
> wrote:
> >
> > --- lgcraymer <lgc at m...> wrote:
> > > Paul--
> > >
> > > Inquiring minds want to know--what's the latest?
>
> > > Can ANTLR be made
> > > to work with GCJ?
> >
> >
> > Thanks for asking. I dropped it right there
> because
> > I'm no java expert. Dunno what to do with these
> > errors. (And with jikes, I'm quite satisfied with
> > the speed of antlr/java)
> >
> > Why don't you coach me a little off the list,
> Loring?
> > Dont think people need to see the gory bits, much
> :-)
> >
> > I'll be a little slow getting back to you right
> now,
> > but I'd be into trying this.
> >
> > If someone else wants to try it also, that would
> be
> > great. Here's my classpath. YMMV.
> >
> > echo $CLASSPATHGNU
> > /usr/local/gcc/gcc-3.3/libjava:\
> >
>
/usr/local/gcc/gcc-3.3/build/i686\-pc-linux-gnu/libjava:\
> > /usr/local/java/j2sdk1.4.2<snip>
> >
> >
> > One doesn't cast while instantiating, so we have
> > to make other objects just to cast them... Or
> what?
> >
> > ----
> > JavaCodeGenerator.java:77: Incompatible type for
> `='.
> > Can't convert `antlr.JavaCharFormatter' to
> > `antlr.CharFormatter'.
> > charFormatter = new JavaCharFormatter();
> > ----
> > CppCodeGenerator.java:97: Incompatible type for
> `='.
> > Can't convert `antlr.CppCharFormatter' to
> > `antlr.CharFormatter'.
> > charFormatter = new CppCharFormatter();
> > ----
> > DiagnosticCodeGenerator.java:33: Incompatible type
> for
> > `='. Can't convert `antlr.JavaCharFormatter' to
> > `antlr.CharFormatter'.
> > charFormatter = new JavaCharFormatter();
> > ----
> > DocBookCodeGenerator.java:40: Incompatible type
> for
> > `='. Can't convert `antlr.JavaCharFormatter' to
> > `antlr.CharFormatter'.
> > charFormatter = new JavaCharFormatter();
> > ----
> > HTMLCodeGenerator.java:37: Incompatible type for
> `='.
> > Can't convert `antlr.JavaCharFormatter' to
> > `antlr.CharFormatter'.
> > charFormatter = new JavaCharFormatter();
> > ----
> >
> > > --- In antlr-interest at yahoogroups.com, paul
> taney
> > > <paultaney at y...>
> > > wrote:
> > > >
> > > > --- Terence Parr <parrt at c...> wrote:
> > > > > Hmm...yeah that looks pretty screwed up to
> > > > > me...can't seem to find any
> > > > > of my classes. Perhaps it a config issue,
> but
> > > I'm
> > > > > guessing that GCJ
> > > > > ain't ready for primetime yet ;)
> > > > >
> > > > > Ter
> > > >
> > > >
> > > > Wait a minute! I needed a star there, right?
> > > >
> > > > $ gcj --classpath $CLASSPATHGNU *.java
>
=== message truncated ===
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list