Java to C++ (simple tool)

Discussion in 'C++' started by Stefan Poehn, Sep 3, 2003.

  1. Stefan Poehn

    Stefan Poehn Guest

    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
     
    Stefan Poehn, Sep 3, 2003
    #1
    1. Advertising

  2. Stefan Poehn

    Attila Feher Guest

    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
     
    Attila Feher, Sep 3, 2003
    #2
    1. Advertising

  3. Stefan Poehn

    Stefan Poehn Guest

    "Attila Feher" <> schrieb im Newsbeitrag
    news:bj42q3$ihp$...
    > 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
     
    Stefan Poehn, Sep 5, 2003
    #3
  4. Stefan Poehn

    llewelly Guest

    "Stefan Poehn" <> writes:

    > "Attila Feher" <> schrieb im Newsbeitrag
    > news:bj42q3$ihp$...
    >> 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.
     
    llewelly, Sep 5, 2003
    #4
  5. Stefan Poehn

    Govindan Guest

    "Stefan Poehn" <> wrote in message
    news:bj41b3$jue$...
    > 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.
     
    Govindan, Sep 9, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith A. Rowe
    Replies:
    2
    Views:
    299
    Keith A. Rowe
    Feb 14, 2004
  2. Stefan Poehn

    Java to C++ (simple tool)

    Stefan Poehn, Sep 3, 2003, in forum: Java
    Replies:
    9
    Views:
    437
    Thomas Weidenfeller
    Sep 5, 2003
  3. Mathias Conradt
    Replies:
    3
    Views:
    3,608
    Andrew Thompson
    Sep 8, 2004
  4. kito
    Replies:
    0
    Views:
    746
  5. Royan
    Replies:
    8
    Views:
    756
    Patricia Shanahan
    Feb 15, 2008
Loading...

Share This Page