- assigned_to: nobody --> calinush
There are further ideas about this here:
http://www.euclideanspace.com/software/language/xes/project/library/
At the moment the program can help to translate the
syntax of one language to another. However, until now
there is no attempt to translate the class libraries
which the program calls.
For example the java program might contain a the
following call:
System.out.println("apperanceBean.writeJava:" + e);
If we are translating the program into a .net language
we would want to translate it as follows:
Console.WriteLine("apperanceBean.writeJava:" + e);
So what I am suggesting is to give XES the ability to
read in a large table containing a column for each
class library and a row for each possible class library
call:
Java .net Qt3
----- -----------------
-------------
System.out.println Console.WriteLine QErrorMessage
XES would then substitute the appropriate text in the
program from the table.
Of course such a simplistic translation cannot
correctly handle all possible differences between the
class libraries but it should provide a starting point
for manual translation.
The advantages of this method are:
* It treats the syntax translation and the library
calls separately (for instance the .net library can
work with several languages or the C++ language can
work with several class libraries).
* Such a large table as this would be difficult to
implement in XSLT.
Implementation Issues
---------------------------
If we take the above example, can we just replace the
'System.out.println' entry in the symbol table with
'Console.WriteLine' and so on. This would seem to be
the quickest approach and I think this would work well
in most cases. The only possible problem would be that
it would be replaced regardless of whether the text is
a library call, an include path, a comment, a string
constant, etc. I think it would add a lot of complexity
as the symbol table would have to have an extra column
to determine if the entry is a library call, an include
path, a comment, a string constant, a method name, a
class name, a variable name etc. So I suggest that we
just do a global replace for the first implementation
and then refine that later if that proves necessary.
User Interface
-----------------
I suggest adding a new 'library translation' tab. This
tab would allow the table to be loaded, displayed,
modified and saved. There would also be buttons to
select the input and output library and a button to do
the translation.