Convert cpp to java

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

utils to convert c++ code to java code

javeme/cpp2java

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Читайте также:  Add value mysql php

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

readme.txt

本程序功能是将c++源码转换为java源码,转好代码将全部放在目标目录下的java文件夹中. 我的主要目的是方便一些算法的迁移,当然也希望能出一个java源码转成c++的,这是求之不得的事,虽然有点复杂,就等待大家的智慧了. 这个软件也只是做了一些基本的直译,很多类还是需要自己手动转换,毕竟方法名称都不大一样, 比如vector转换成ArrayList,同样添加元素前者是push_back,而后者是add,此外有一点特别注意的地方,c++的string截取字串方法substr(strat,offset)和java的String方法substring(start,end)有很大差别,我就调试了好久才发现. 有什么好的方法来改进程序,希望联系本人javaloveme@gmail.com.

About

utils to convert c++ code to java code

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A translator to convert C++ to Java. A work in progess.

License

danfickle/cpp-to-java-source-converter

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This project aims to convert C++ code to high level Java source code. Where that is not possible, a TODO should appear in the generated source code.

The project is about three quarters of the way to an initial release. The below items will not be handled by the initial release:

  • goto statement
  • untyped malloc
  • template code generation (generics to be used instead).
  • C++/C std lib
  • order of operation differences
  • platform dependent/undefined behavior
  • unions
  • dynamic cast and other RTTI features
  • multiple inheritance
  • C++11 features
  • overloaded operator new and operator delete memory management

Everything else should work with the initial release.

The following lines give an indication of what generated code using pointers looks like.

// Test plain assignment. f[4] = 111; *f = 112; (((*(f + 2)))) = 113; *(f--) = 114; // Test compound assignment. f[1] *= 3; (*f) += 4; // Test pointer comparison f < &f[1]; &f[0] == f; // Test addressof ptr &f;
f.ptrOffset(4).set(111); f.set(112); ((((f.ptrOffset(+2))))).set(113); (f.ptrPostDec()).set(114); f.ptrOffset(1).set(f.ptrOffset(1).get() * 3); (f).set((f.get()) + 4); f.ptrCompare() < f.ptrOffset(1).ptrCompare(); f.ptrOffset(0).ptrCompare() == f.ptrCompare(); f.ptrAddressOf();

This fork will build with Maven. Eclipse CDT is not in Maven central, or any repository I could find, but for your convenience, private copies of certain JARS are shipped in the lib/ directory:

  • org.eclipse.cdt.core_5.4.1.201209170703.jar
  • org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
  • com.ibm.icu_50.1.1.v201304230130.jar (I needed it at run-time once to fix a logging error)

Please note these are from a separate project with separate licenses.

These are the JAR files I use to get this code to run. They are from Eclipse Juno (4.2.x) and CDT 8.1.1 for Eclipse Juno. Additionally, jOOR is required by the runtime template handling code.

  • Eclipse downloads
  • CDT downloads
  • jOOR at Github
  • org.eclipse.cdt.core_5.4.1.201209170703.jar
  • org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
  • joor-0.9.3.jar

This project is licensed under the Apache license. The CDT walking code is based loosely on code I found (and lost the url) on the web (also licensed under the Apache license).

This is an incomplete and fluid list of items that need doing before the initial release.

  • General
    • Lots more assertions
    • Destructor calls on static duration objects
    • Cast operators other than C style cast should not resolve overloaded operator cast
    • Basic type classes other than MInteger
    • Global variables
    • Templates
    • Should be able to take the address of an enumerator
    • Putting in comments/defines from original
    • A lot of work on multi dimension arrays.
    • cleanup cpptojavatype method.
    • function pointers.
    • typed malloc.
    • testing cleanup.
    • making logger useful.
    • relacing deprecated methods.
    • make lists.
    • correct names (camel case, capitalized classes etc.)
    • Varargs.
    • Bracketed expressions
    • Special case this pointer and void pointer.
    • exact bit position for bitfield.
    • Recursively evaluate templates and generate expanded cpp code.
    • Generate implicit special methods and output cpp code.
    • Record if a basic variable(int, bool, etc) has its address taken so we can skip objectifying it if it does not.

    About

    A translator to convert C++ to Java. A work in progess.

    Источник

    Online CPP to JAVA Conversion

    Conholdate CPP to JAVA Conversion is cross platform and cross browser conversion app that allow you to convert CPP to JAVA in any modern browser (Chrome, Safari, Firefox, Opera, Tor, etc) and on any OS (Windows, Unix and MacOS) despite your PC specifications. Converted CPP to JAVA will maintain original document structure, content and styles. CPP to JAVA Convertor app is built on top of high quality document conversion engine which provides outstanding conversion results and performance, our goal is to offer secure and best conversion experience to our users. Conholdate.Conversion app offers an OCR feature that allows you to parse image files and export data into Excel documents, for example convert PNG to Excel.

    How to Convert CPP to JAVA

    1. Click inside drop area or drag & drop your file.
    2. Wait until CPP to JAVA file is uploaded.
    3. Select output format from dropdown menu.
    4. Click on Convert button to start CPP to JAVA conversion.
    5. Download or share resulted file.

    FAQ

    Q: How to convert CPP to JAVA file?

    A: Upload you file by drag and drop it to the upload zone with label «Click or drop your files here» or click on it to select file using file explorer. After that select destination format in which you want to convert your file and click Convert button.

    Q: Can I extract tables from images (PNG) and export them to Excel files?

    A: Yes you can. Conholdate Image to Excel conversion will parse image files using OCR feature and extract text and tables data. Extracted data can be saved into various formats, such as Excel, OpenOffice and more.

    Q: How many files can be converted at a time?

    A: You can convert 1 file at a time.

    Q: What is the maximum allowed file size?

    A: Maximum allowed file size to upload and convert is 20 Mb.

    Q: What are the ways to get my conversion results?

    A: At the end of the conversion process, you will get a download link. You can download the results immediately or send the link to your email.

    Q: How multi page document is converted to image?

    A: Each page of such a document will be saved as a separate image. After conversion process is finished you will get a package of such images.

    More Apps

    Источник

    File extension : Convert CPP to JAVA

    The .CPP format belongs to the C++ programming language and is used to store source code. These source code files are often part of a collection/project. When compiled, these files are built in to executable programs.

    File extension Java Source Code (.JAVA)

    Question: What is an JAVA File?
    Have you found, downloaded or received an JAVA file, but don’t know which software program is required to open it? Before attempting to open an JAVA file, you’ll need to determine what kind of file you are dealing with and whether it is even possible to open or view the file format. Answer: Files which are given the .JAVA extension are known as Java Source Code files, however other file types may also use this extension. If you are aware of any additional file formats that use the JAVA extension, please let us know. How to open a JAVA file:
    The best way to open an JAVA developer file is to simply double-click it and let the default assoisated application open the file. If you are unable to open the file this way, it may be because you do not have the correct application associated with the extension to view or edit the JAVA file. This developer file format was added to our database by a visitor to this site, but no additional information was provided. We have yet to investigate this file type further, or there was not enough information available at the time to report accurately on the format. Please check back soon for more information as we are constantly updating our file descriptions based on search frequency. Tip: Try to open the JAVA file using a text-editor such as Notepad, as many file types contain simply contain unformatted plain-text and can viewed correctly using this method.

    Источник

Оцените статью