Skip to content
pja35 edited this page Oct 23, 2012 · 30 revisions

Say you write a program in GOOL and want to produce Java, C++, C#, and run this output. Here is how to proceed.

Write a GOOL source file

  • By default, place them in input/. You can change this in gool.properties.
  • An example file Test.gool is provided.

Run the GOOL compiler

  • Run the Main() of GoolCompiler. For instance by doing: Eclipse > GOOL > gool.GoolCompiler > Run.

Retrieve the translated code

  • By default, it will be found in output/java, output/csharp, output/cpp. You can change this in gool.properties.

Run the translated code

Via the terminal:

  • javac -d output/java/Test.class output/java/Test.java; java output/java/Test.class
  • gmcs -debug+ /t:exe /out:Test.exe output/csharp/Test.cs; mono output/csharp/Test.exe (In Linux)
  • g++ -I /usr/include/ -o output/cpp/Test.bin output/cpp/Test.cpp; output/cpp/Test.bin

Clone this wiki locally