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

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.xxx tells the user of the GOOL system which are the primitives that are recognized. 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.

Clone this wiki locally