Here is sed for windows, the stream editor.
The following sed commands:
s/main/Main/
s/String/string/
s/System.out.println/System.Console.WriteLine/
Can transform the cannonical java hello world:
public class Hello
{
public static void main(String[] args)
{
System.out.println(“Hello, World”);
}
}
into the cannonical C# hello world
public class Hello
{
public static void main(String[] args)
{
System.out.println(“Hello, World”);
}
}
This is a starting point for a java to c# cross complier.
It would be interesting to try to apply this to a more complex java application.
Add a few interop base classes and we have a useful product.
Given that the two languages have very similar syntax it could be an easy task.
The only trick would be replacing extends and implements, but the super sed that I linked to has multi-line pattern matching!