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 ../GOOLJAVA, ../GOOLCS, ../GOOLCPP. You can change this in gool.properties.

Run the translated code

Via the terminal:

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

Via eclipse, Java generated code:

  • Eclipse > New > Project... > C++ Project, Location: ../GOOLJAVA, Empty project.
  • Eclipse > GOOLJAVA > Run as... Java application.

Via eclipse, C# generated code:

  • Eclipse > New > Project... > C# Project, Location: ../GOOLCS, Empty project.
  • Eclipse > GOOLCS > Build.
  • Eclipse > GOOLCS > Run as... C# application.

Via eclipse, C++ generated code:

  • Eclipse > New > Project... > C++ Project, Location: ../GOOLCPP, Empty project.
  • Eclipse > GOOLCPP > Build.
  • Eclipse > GOOLCPP > Run as... Local C/C++ application.

Clone this wiki locally