XES - Project Plan - Class Library Translation phase 2

This proposed enhancement is in the Sourceforge feature request system.

This is a continuation of the class library translation feature here. The first version provided for a simple substitution of one symbol table entry for another but we really need a more complex translation, In the following example:

Java .net

import java.lang.System;
System.out.println("error: " + e);

using System;
Console.WriteLine("error: " + e);

We want to:

  1. Translate the import 'java.lang.System' to the equivalent in the destination language for example 'System'.
  2. The translation must be able to handle wildcards, for instance 'import java.lang.*;'
  3. Then we want to translate any external method calls and parameters. In this case we want to translate 'System.out.println' to 'Console.WriteLine'.
  4. If there is no import 'java.lang.System' but instead we have a system defined locally then we want leave the class name as it is.
  5. If the text 'java.lang.System' appears in a comment or a string constant then we want leave the string as it is.

Note: the syntax and keywords (such as 'import' to 'using') are translated by parser when reading or XSLT when exporting so do not need to translated by this method.

To implement this we need to go though this sequence:

  1. Translate the package/method names in the import statements to Java package/method names.
  2. Load the external references described here with information about other classes in the current packages and packages/classes referenced in import statements.
  3. All references to classes, methods and parameters must be matched to their definitions which might be in the local file structure or in the external references. When the definition is found it is recorded in the node that uses it as an XPath string.
  4. Where the definition is an external import it is translated into the equivalent Java name.




metadata block
see also:


Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover The Java Developer's Guide to Eclipse.

Other Java books

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.


cover EOVIA Carrara Studio 2 (Windows) - This is a commercial 3D modelling tool with some Physics simulation. I think it is aimed at games and animations, not for accurate physics simulation. Eovia (http://www.eovia.com).

See carrara site for information about version 3 launch in Sept 2003.

cover Carrara 3D Basics - A simpler low cost version

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.