Related articles |
---|
[2 earlier articles] |
Re: anyone interested in decompilation martin@gkc.org.uk (Martin Ward) (2006-08-04) |
Re: anyone interested in decompilation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-08) |
Re: anyone interested in decompilation Juergen.Kahrs@vr-web.de (Juergen Kahrs) (2006-08-10) |
Re: anyone interested in decompilation kym@ukato.freeshell.org (russell kym horsell) (2006-08-11) |
Re: anyone interested in decompilation chris.dollin@hp.com (Chris Dollin) (2006-08-12) |
Re: anyone interested in decompilation Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2006-08-13) |
Re: anyone interested in decompilation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-14) |
Re: anyone interested in decompilation DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-08-14) |
Re: anyone interested in decompilation chris.dollin@hp.com (Chris Dollin) (2006-08-14) |
Re: anyone interested in decompilation barry.j.kelly@gmail.com (Barry Kelly) (2006-08-15) |
Re: anyone interested in decompilation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-15) |
User defined precedence for user defined operators. derek@knosof.co.uk (Derek M Jones) (2006-08-15) |
From: | glen herrmannsfeldt <gah@ugcs.caltech.edu> |
Newsgroups: | comp.compilers |
Date: | 14 Aug 2006 15:06:27 -0400 |
Organization: | Compilers Central |
References: | <1154507032.629515.108580@m79g2000cwm.googlegroups.com> 06-08-017 06-08-037 06-08-047 06-08-060 06-08-065 |
Keywords: | disassemble, Java |
Posted-Date: | 14 Aug 2006 15:06:27 EDT |
Jürgen Kahrs wrote:
(snip regarding Java, JVM, pointers, and references)
> The Java type "reference" misses not only pointer arithmetic but also
> type casting (of pointers) and the address operator (&). You may of
> course argue that such features are not desirable. The absence of
> such feature makes it much harder to write compilers for a translation
> from ISO C to JVM.
Well, if a pointer variable includes a reference and offset, it
comes close to what is needed. Arithmetic operations only change
the offset, and the offset is used when the pointer is dereferenced.
(Note that C make no guarantee as to the result of comparison
other than equal/not equal for pointers to different objects.)
The & operator is different. As far as I know, you have to make
all scalar variables into arrays dimensioned one. Then they can
be referenced as arrays are. Another way is to allocate all
scalar variables of a given type as one array with different
offsets. That might be more C like!
I have, for example, used an array dimensioned one with a Hashtable,
and can then dereference it and increment it in one expression,
after having tested that the entry exists.
-- glen
Return to the
comp.compilers page.
Search the
comp.compilers archives again.