473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Java to C++ (simple tool)

Hi

does anybody know a tool that converts Java-Code to
C++? I need a very simple converter that does NOT need to
cover Threading, Swing, Exceptions, Reflection, RMI,
Security, Networking and most of java.util (except LinkedList).
It also does not need to cover garbage collection (new is not allowed
in the java code that should be converted).

TIA
Stefan


Jul 19 '05 #1
4 6557
Stefan Poehn wrote:
does anybody know a tool that converts Java-Code to
C++? I need a very simple converter that does NOT need to
cover Threading, Swing, Exceptions, Reflection, RMI,
Security, Networking and most of java.util (except LinkedList).
It also does not need to cover garbage collection (new is not allowed
in the java code that should be converted).


The only thing I did find is this:
http://www.bekkoame.ne.jp/~mizutori/script/
However if you search with Google for "Java to C++" you will get a million
hits for tutorials, and one of them seems to give all the knowledge you need
to make a script (like in Perl):

http://icie.cs.byu.edu/cs240/javac.html

So IMHO you are better off make this simple script yourself.

--
Attila aka WW
Jul 19 '05 #2
"Attila Feher" <at**********@lmf.ericsson.se> schrieb im Newsbeitrag
news:bj**********@newstree.wise.edt.ericsson.se...
Stefan Poehn wrote:
does anybody know a tool that converts Java-Code to
C++? I need a very simple converter that does NOT need to
cover Threading, Swing, Exceptions, Reflection, RMI,
Security, Networking and most of java.util (except LinkedList).
It also does not need to cover garbage collection (new is not allowed
in the java code that should be converted).
The only thing I did find is this:
http://www.bekkoame.ne.jp/~mizutori/script/
However if you search with Google for "Java to C++" you will get a million
hits for tutorials, and one of them seems to give all the knowledge you

need to make a script (like in Perl):

http://icie.cs.byu.edu/cs240/javac.html


I think there is missing one point. If you have an object as an argument to
a function in Java, you pass it by reference. In C++ you make a copy as
far as I know. That is, you can change the values of an object in a function
called by some callee and the callee gets the changed object in java, not
in C++. Am I right?

Stefan
Jul 19 '05 #3
"Stefan Poehn" <po***@IH8SPAMbms.de> writes:
"Attila Feher" <at**********@lmf.ericsson.se> schrieb im Newsbeitrag
news:bj**********@newstree.wise.edt.ericsson.se...
Stefan Poehn wrote:
> does anybody know a tool that converts Java-Code to
> C++? I need a very simple converter that does NOT need to
> cover Threading, Swing, Exceptions, Reflection, RMI,
> Security, Networking and most of java.util (except LinkedList).
> It also does not need to cover garbage collection (new is not allowed
> in the java code that should be converted).


The only thing I did find is this:
http://www.bekkoame.ne.jp/~mizutori/script/
However if you search with Google for "Java to C++" you will get a million
hits for tutorials, and one of them seems to give all the knowledge you

need
to make a script (like in Perl):

http://icie.cs.byu.edu/cs240/javac.html


I think there is missing one point. If you have an object as an argument to
a function in Java, you pass it by reference. In C++ you make a copy as
far as I know. That is, you can change the values of an object in a function
called by some callee and the callee gets the changed object in java, not
in C++. Am I right?


This is the default behavior of C++. However, by using C++ references
(which are not Java references), or C++ pointers, one can get
Java-like behavior.

I don't think a non-trivial script can deal with this incompatiblity
(or the dozens of others which exist.) Java -> C++ requires a
full-blown Java compiler, I think.
Jul 19 '05 #4

"Stefan Poehn" <po***@IH8SPAMbms.de> wrote in message
news:bj**********@news.space.net...
Hi

does anybody know a tool that converts Java-Code to
C++? I need a very simple converter that does NOT need to
cover Threading, Swing, Exceptions, Reflection, RMI,
Security, Networking and most of java.util (except LinkedList).
It also does not need to cover garbage collection (new is not allowed
in the java code that should be converted).

TIA
Stefan


Try looking at compiler-compilers like Gentle, ANTLR etc may give some links
to what you are searching for.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: tmb | last post by:
1 - Can you build an entire web page or site with Java... sorta like you can with Flash? 2 - Can you do... .. Drag & Drop .. Push Buttons .. Hot Spot .. Hot Object .. Pull Down's (combo...
0
by: Cees Wesseling | last post by:
For a couple of years I am using now my own data binding tool that can create C++ classes from a DTD. At this moment I need to reconsider this tool since I want to use W3C XML Schemas and need to...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
8
by: Gabriele | last post by:
I'm studying differences between those two architecture in order to choose a setup to develop a completely new application. I'm a programmer with some experience on C++ and PHP and i have basic...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.