How CodePorting Engine converts C# Code to Java

Posted in the Programming Languages Forum

Zarfishan

Multan, Pakistan

#1 Jul 10, 2012
CodePorting is a web-based C# to Java converter that allows you to convert your C# code to java accurately. CodePorting use a powerful parsing engine that translates million of lines of codes from C# to java and also ensures that quality and formatting of the generated code is preserved. Codeporting makes your application platform independent and you can get your code converted in no time. CodePorting provides you the most secure, reliable and productive code conversion by using absolute converting engine.

CodePorting is very simple to use and it provides you accurate result. You only need to sign-in and start converting your code without installing any application. Let’s now have a look at how it actually works to provide the code translation that is quick, secure and accurate.

• Parses C# source code
• Translates the syntax
• Intelligently converts .NET classes/methods to Java using CodePorting C#2Java maps
• Prints newly generated code to Java file

CodePorting use highly developed C# 2 Java parser which convert C# code to tree. This tree goes through many phases and convert the C# syntax into Java syntax and finally generate the accurate java code. In the last phase classes/members that are found in the mapping file provided by user are converted to java names and their imports are added. Once this is done tree is embedded to java file.

The first thing you need to do is to upload your C# source code to codeporting. We support three different methods for the purpose; let’s have a look at each of it:

• Direct source code upload: You can upload the C# code directly to the porting engine.

• Source code repository import: You can create your project by importing C# code in CodePorting from code repositories, both public and private.

• Source code conversion through Microsoft Visual Studio Add-in: You can convert your complete .NET application to CodePorting through this add-in instantly. Upload the source code from Visual Studio and get your code converted into Java without leaving the local environment. You may choose to convert a single file or a complete project by installing the add-in to your Visual Studio environment.

After uploading the code using one of the above method, the conversion cycle starts. The parsing engine performs various core activities where C# code and library mappings work together to generate the final output file. The C# Code is parsed and syntax tree is generated to be translated into java.

The important part of the whole process is mapping and codeporting mapping library includes Java classes with interfaces matching .NET classes. Codeporting has created classes/methods for most frequently used C# classes and and they are continuously adding more classes/methods in the library. CodepOrting has also given this opportunity to user to add a class in the C#2Java library in case of the class does not exist with the same functionality.

After mapping and conversion the parsing engine generated the file java code ready to be used as a platform independent application/code which provides the same functionality as C# code. This process eliminates the massive amount of work needed to convert to C# code to Java manually.

Tell me when this thread is updated:

Subscribe Now Add to my Tracker

Add your comments below

Characters left: 4000

Please note by submitting this form you acknowledge that you have read the Terms of Service and the comment you are posting is in compliance with such terms. Be polite. Inappropriate posts may be removed by the moderator. Send us your feedback.

Programming Languages Discussions

Title Updated Last By Comments
Helping with homework (Jul '13) Sep '14 HAM 12345 2
Golan the Insatiable's Josh Miller Sep '14 Repsdesign 1
Alba wins the prestigious 2014 RoSPA Gold Award... Aug '14 NITiN 1
Yeshiva University Will Sell Off Buildings, Cut... (Dec '13) Jul '14 EVIL FUSION CENTERS 3
Pixelsilk: SEO-Friendly Content ManagementA System (Dec '09) Jul '14 diemx 3
Free Java book to download: Beginning J2EE 1.4,... (Sep '07) Jul '14 suvankar 52
Python bumps off Java as top learning language Jul '14 orang awam 1
More from around the web