octopus
Code Samples

Here we show you some non trivial samples. These code is directly generated with our online Octopus service. You can follow the instructions to generate the code by yourself.

1. Microsoft .NET Framework TypeFinder Sample

This sample is located in .NET Framework SDK samples\Applications\TypeFinder folder, you can upload the source file (FinderType.cs, FinderType.vb) and choose a translation type to retrieve the code listed below,

(1) Translation from C# code

Original (C#) Translated (VB.NET) Translated (VC++.NET)
FindType.cs AssemblyInfo.vb
App.vb
FindType.vb
IndentedWriter.vb
AssemblyInfo.cpp
App.cpp
FindType.cpp
IndentedWriter.cpp
App.h
FindType.h
IndentedWriter.h
StdAfx.h
StdAfx.cpp

(2) Translation from VB.NET code

Original (VB.NET) Translated (C#) Translated (VC++.NET)
FindType.vb AssemblyInfo.cs
App.cs
FindType.cs
IndentedWriter.cs
AssemblyInfo.cpp
App.cpp
FindType.cpp
IndentedWriter.cpp
App.h
FindType.h
IndentedWriter.h
StdAfx.h
StdAfx.cpp

2. Java to C# Translation

Java to C# translation tool is part of our Java.NET development efforts. This tool has been used to convert many java code to C#, and resulting code can be linked with our Java.NET runtime, or Microsoft J# library. Below is a simple example, which illustrates that our java to C# translation tool is of production quality.

Original (Java) Translated (C#)
SimpleTest.java SimpleTest.cs
ChildClass.cs
SimpleException.cs

To compile the generated code, you need to install J# runtime, and compile with csc compiler as follows:
csc /r:"C:\WINDOWS\Microsoft Visual JSharp .NET\Framework\v1.0.4205\vjslib.dll" SimpleTest.cs ChildClass.cs SimpleException.cs

3. Java to native C++ Translation

This is a class taken from our production salamander decompiler code, which decompiles .NET custom attributes. Our java to c++ tool has been developed long before Microsoft .NET was made public. It was internally used to convert our java programs so we can deliver a native exetuable for best protection. Our decompiler is being developed by Java, then converted to C++ code to produce a native exe file using our tool. Below is a simple example, which illustrates that our java to C++ translation tool is of production quality.

Notice this is not Visual C++.NET, rather it is the old traditinal C++.

Original (Java) Translated (Native C++)
CustomAttribute.java CustomAttribute.h
CustomAttribute.cpp
TypeValue.h
TypeValue.cpp