Read Me
JComp
-----
JComp is an effort to create a program which is capable of translating
program source codes to different programming languages. As the task
is quite complicated, the current (and probably later) version is quite
limited. It seems to work for the mini programs in test directory.
How to invoke
-------------
As now some minimal GUI is available, probably the easiest way to try
it out is to run GUI mode:
java -jar JComp.jar
A window with 3 tabs should appear.
In "Source" tab , choose source language in "Format" dropdown,
set "in" to input file, "lib" for the library directory of source
language. It will most likely be "lib/<format>/<dialect>".
You should probably leave dialect on the choice which appears.
The rest just have less features, or simply refuse to work.
You can go on to "Destination" tab and fill it similarly. As "out"
you can choose an output directory. Some translations make more
sources from one.
Go to "Progress" tab and click on "Start". If you are lucky you will get
an output without a stack trace. That means you get your translated source
in the output directory.
How to invoke with command line
-------------------------------
You can type
java -jar JComp.jar -h
The program will show the available command line arguments.
An example:
java -jar JComp.jar -d -s c#in=test/c/hw.c#lib=lib/c/gcc php#lib=lib/php/c#out=test/c_php.dir
Would translate with debug information and exception trace from
language C the file "test/c/hw.c" using library in "lib/c/gcc"
to PHP language using library in "lib/php/c" to "test/c_php.dir" directory.
How to run tests
----------------
You could simply type
ant test
In case ant is installed in your system it should go through test directory
and translate sources to <from>_<to>.dir destination directories.
Compiling or running result files may need
some "lib" directories (e.g. javac -cp ../../lib/java/pascal hw/Hw.java)
or using config files (e.g. php -c ../php/c.ini hw.php).
Notes:
------
Of course there are tons of limitations, more than features.
You can make program better by leaving constructive comments
on sourceforge page:
http://sourceforge.net/projects/jcompi/
Have fun,
Várnagy Zoltán