Skip to content
pja35 edited this page Nov 14, 2017 · 1 revision

Translating without the web client.

You can launch gool manually to process input files. Put the files you want to process into the input directory defined by the property java_in_dir or cpp_in_dir depending the input language you chose to translate.

The translation will be done according to the properties given in the properties file. There are two ways to launch the manual translation:

Manual configuration

First edit manually with your favorite text editor the src/main/resources/gool.properties file and check that the properties are well defined for your translation:

  • input_langage: language of your files to translate.
  • cpp_compiler_cmd: c++ compiler command ("g++" on Debian systems). It is actually used only by the integration tests.
  • cpp_in_dir: input directory containing the c++ input files.
  • cpp_in_dir_tmp: input temporary directory that GOOL will use to store temporary cpp files.
  • cpp_in_libraries: path to the local c++ librairies. It is actually used only by the integration tests.
  • boost_lib_dir: path to the local boost directory. It is actually used only by the integration tests.
  • cpp_ref_dir: path to the test reference c++ files. Those files are used by the integration tests as gold references.
  • cpp_out_dir: output directory for the c++ translated files.
  • java_in_dir: input directory containing the java input files.
  • java_in_dir_tmp:input temporary directory that GOOL will use to store temporary java files.
  • java_out_dir: output directory for the java translated files.
  • csharp_compiler_cmd: the C# compiler command ("mcs" for Debian systems). It is actually used only by the integration tests.
  • csharp_out_dir: output directory for the C# translated files.
  • python_ref_dir: path to the test reference python files. Those files are used by the integration tests as gold references.
  • python_out_dir: output directory for the python translated files.
  • gool_library: name of the gool library that is used as dependency during java to any output language translation.

Then launch the gool translation on your files by launching the gradle run task:

./gradlew run

The resulting translated files are stored in the output directories of each output language.

Graphical interface for properties setting

You can also set the properties within a graphical interface by launching:

./gradlew run -PappProp=-gui

Translating within the web client.

You first need to launch the GOOL server:

./gradlew serverRun

Then you have to open the index.html file with your favorite browser.

  • Select the input language with the scroll top left button (c++ or java).

  • Copy the code you want to translate into the "input language" text box.

    All java input code must be contained in a class.

    All C++ input code must be either contained in a class or in a main function

  • Select the output language with the scroll top right button (c++, java, C# or python).

  • Click on the "translate" button.

  • The translated code can contain many files. Each file is presented in a new tab.

  • If you want to execute the translated code, select the tab that does contain the main function and click on the "Execute button".

    Execution are launched in docker images. You should have docker installed locally to execute your code. See Docker installation doc.

  • All errors and standards output during both translation and execution are given at the bottom of the page.

Clone this wiki locally