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

Here is how to work together to grow GOOL.

How to work with Git

The workings of Git are explained here. Basically, make sure you have set-up Git appropriately first, cf. Installation and here. Then, fork the project into your group's repository, where you and your group will modify it. The way you and your group will work is by:

  • changing you local copy
  • committing the changes locally
  • pushing the changes to the group's repository
  • pulling someone else's changes from the group's repository

Once you reach an improved version, make a Pull request to the mother repository so that your improvements get integrated. Collaboration is helped by the social features of Git.

How to extend the recognition of an input language

The package gool.recognizer.xxx defines a visitor, which travels the xxx input (abstract), and produces its GOOL representation (abstract).

The package gool.imports.xxx tells the user which are the primitives of the xxx input language that are recognized by the GOOL System. They must be kept up-to-date.

How to extend the code generation of an output language

The package gool.generator.yyy defines a visitor, which travels the GOOL representation (abstract), and produces the yyy output (concrete).

How to add an input language

In order to add an xxx input language, you need a parser that takes concrete input language into abstract input langue. The place to do this is gool.parser.xxx.

You need to define a visitor, which travels the xxx input (abstract), and produces its GOOL representation (abstract). The place to do this is gool.recognizer.xxx.

You need to define a xxx input directory in gool.properties.

How to add an output language

In order to add a yyy output language, you need a visitor, which travels the GOOL representation (abstract), and produces the yyy output (concrete). The place to do this is gool.generator.yyy

You also need to define a helper for executing the yyy output concrete code. For some languages, such as Java or C++, the output concrete needs to be compiled by the native yyy compiler first. The place to do all this is gool.executor.yyy.

You need to define a yyy output directory and some yyy execution commands in gool.properties.

How to extend the GOOL intermediate language

The GOOL intermediate language is the bridge between the input language and the output language. To have more things usefully translated through that bridge, one may need to enlarge the bridge. This means extending the GOOL abstract language defined as an Abstract Syntax Tree in gool.ast.