C++ To Java Converter

C++ to java converter reddit

Why automatic translation?

An automatic, complete and correct translation - compared to a manual translation - has the advantage that the whole codebase can be migrated instantly (instead of needing months or years) and the resulting translation is fully functional (instead of losing the quality of well-tested software by rewriting it from scratch).

C++ To Java Converter Online


One.C file, containing all method bodies referenced in the.H file. C2j is basically a shell-script that calls sed, a C-to-Java translator, and the C pre-processor to do all the weaving of moving methods into one Java class definition. This parser currently uses a shell script and a Unix utility called 'sed'. C to Java Translation Automatic, Complete, Correct; Low Cost + Low Risk We translate C source code to Java source code. The translation is completely automatic, supports the entire C language and creates functionally equivalent Java code - ready to be executed. So, in order for a tool to convert a C# application which uses delegates it would have to translate the structure from using delegates to an implementation of the observer pattern. Another problem is the fact that C# methods are not virtual by default while Java methods are. Additionally, Java doesn't have a way to make methods non virtual.

It has the disadvantage however that fully automatic translation cannot always guarantee optimal readability: it may introduce non-natural code fragments, which, however, can be optionally rewritten by hand, at a fraction of the cost of a full manual translation.

How does the quality of the translated code compare to manually written Java code?

Readability and maintainability of the resulting code was one of the main focuses from the start. The translation applies numerous optimizations to make the Java code look as natural as possible. Take a look at the Demo section to get an impression of the code quality you can expect.

Which C standards are supported?

We adhere to specific compiler implementations, not to C standards. This way we can guarantee that the translation is functionally equivalent to the original C code even when that code relies on compiler-specific behavior. We support all recent versions of GCC and can adapt our translation to other compilers and C dialects upon request.

How is a project translated?

Translating a C project is as easy as doing a regular build of it. During compilation our system collects all the required data (C code, linked libraries, ...). After a successful build, the collected data can directly be translated to Java.

C++ To Java Converter Online

Such a translation corresponds to a specific configuration of the C project. If the project has multiple configurations (for example, targeting different platforms), it is translated once for each configuration, and then all the resulting translations are merged into one Java project.

C++ To Java Converter Github

Does it really work?

C++ To Java Converter online, free

Yes! The theoretical basis for the translation has been developed at ETH Zurich, as part of the PhD thesis of Dr. Marco Trudel. The project website contains a list of peer-reviewed publications that describe the technical details of the translation.