Java to C++ (simple tool)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan Poehn

    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




  • Attila Feher

    #2
    Re: Java to C++ (simple tool)

    Stefan Poehn wrote:[color=blue]
    > 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).[/color]

    The only thing I did find is this:
    GMOインターネットグループは、インターネットインフラ事業、インターネットセキュリティ事業、インターネット広告・メディア事業、インターネット金融事業、暗号資産事業を展開し、日本のインターネットを支える総合インターネットグループです。「すべての人にインターネット」をコーポレートキャッチに、お客様の笑顔と感動を創造することを目指しています。



    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):



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

    --
    Attila aka WW


    Comment

    • Stefan Poehn

      #3
      Re: Java to C++ (simple tool)

      "Attila Feher" <attila.feher@l mf.ericsson.se> schrieb im Newsbeitrag
      news:bj42q3$ihp $1@newstree.wis e.edt.ericsson. se...[color=blue]
      > Stefan Poehn wrote:[color=green]
      > > 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).[/color]
      >
      > 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[/color]
      need[color=blue]
      > to make a script (like in Perl):
      >
      > http://icie.cs.byu.edu/cs240/javac.html
      >[/color]

      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


      Comment

      • llewelly

        #4
        Re: Java to C++ (simple tool)

        "Stefan Poehn" <poehn@IH8SPAMb ms.de> writes:
        [color=blue]
        > "Attila Feher" <attila.feher@l mf.ericsson.se> schrieb im Newsbeitrag
        > news:bj42q3$ihp $1@newstree.wis e.edt.ericsson. se...[color=green]
        >> Stefan Poehn wrote:[color=darkred]
        >> > 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).[/color]
        >>
        >> 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[/color]
        > need[color=green]
        >> to make a script (like in Perl):
        >>
        >> http://icie.cs.byu.edu/cs240/javac.html
        >>[/color]
        >
        > 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?[/color]

        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.

        Comment

        • Govindan

          #5
          Re: Java to C++ (simple tool)


          "Stefan Poehn" <poehn@IH8SPAMb ms.de> wrote in message
          news:bj41b3$jue $1@news.space.n et...[color=blue]
          > 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
          >
          >
          >
          >[/color]

          Try looking at compiler-compilers like Gentle, ANTLR etc may give some links
          to what you are searching for.


          Comment

          Working...