Sorry
BLS
nanali at wanadoo.fr
Mon Oct 23 07:53:56 PDT 2006
...writing a message frustated and in a bad mood never has been an good
idea. <<D not for me anymore>>
What I've said was too negative and at least not fair against all the
efforts allready made.
So, my apologies. Sorry!
Why this frustration : Simply because I have tried to translate some
Java code into D. I wasn't able to do that because even a small Java
programm allmost depends on java.util /*collections (Hashmap,
Hashset,Hashtable, ...) */ as well as Java array and strings.
Due to the fact that phobos doesn't offer much support for these basic
data structures it is, at least, very difficult to translate Java into
D. (even by hand)
Meanwhile (today) I have seen that Mango offers something from
java.util.* (even if it is not part of the binary ditribution) *and*
listening to Walter's RedBackTree query, I have some hope that mango
collections will find a way into phobos.
Next : I am still convinced that a semi automatic Java to D Translation
is possible if we just have these java-like collections, a compatible
Sting and Array??? class.
Some of you may have noticed that I spend some time on a translator tool
like that. What I'll publish here in the attachemenmt is a not my code.
The Code-Emitter attached is based on a Java Tree Parser.
But you'll agreee : The following,attached Java code can be adapted to
produce valid D code.
Björn
To test: You need 1) ANTLR 2.7.5/6, 2) Java 1.3 respectice 1.5 grammar
and tree-grammar from the ANTLR Hompage 3) The attached file.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Emitter.java
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20061023/a6ae95bb/attachment.ksh>
More information about the Digitalmars-d
mailing list