Repository navigation
How does it work?
pja35 edited this page Oct 30, 2012
·
50 revisions
Everything that one needs to know in order to understand the code of the project.
Vocabulary:
- A concrete language is the program as written in a file, for instance
System.out.println("Hello")is Java concrete language for printing out to the screen. - An abstract language is the computer's representation of the program, as an Abstract Syntax Tree, held in memory.
- An input language is what the GOOL system takes as input.
- A primitive is a piece of abstract language.
- Recognition is when a specific input primitive (e.g. Java Lists) is associated a specific GOOL primitive (e.g. GOOL Lists).
- Generation is when a specific GOOL primitive (e.g. GOOL Lists) is associated a specific output primitive (e.g. C# Lists).
- Passing on is when a specific primitive is associated a generic primitive.
Words of explanation:
- If the input language is concrete, then it will be made abstract in the easiest way available: the input's language native parser.
- The abstract input language then gets translated into the common abstract language GOOL.
- During this process, certain primitives are recognized, meaning that GOOL is aware of the specific nature of this primitive. Others are not; they are represented in a generic manner.
- The GOOL abstract language then gets translated into Output concrete language.
- During this process, recognized primitives, if code generation is available for them, get implemented in as primitives of the output language. The others are simply translated in a syntactic, generic manner.
- The generated concrete code can be compiled and run.
We explain which package does what. The order is chronological with respect to the above Figure. Within each package, each file comes with an explanation of its purpose.
-
gool: the root, and handling global settings. -
gool.imports.xxx: as information to the user telling him which subset the xxx input language is recognized. -
gool.parser.xxx: parsing the xxx input language from concrete to abstract. -
gool.recognizer.xxx: translating the xxx input abstract language to its GOOL abstract language representation. -
gool.ast: the description of the GOOL abstract language. -
gool.ast.constructs: the representation of basic, syntactic constructs (assignment etc.) for passing on. -
gool.ast.__________: the representation of the more advanced, recognized primitives (lists etc.) for implementation. -
gool.ast.printer: pretty printing GOOL. -
gool.generator.yyy: translating the GOOL abstract language into yyy output concrete language. -
gool.generator.common: the classes that must be extended to write agool.generator.yyy. -
gool.generator: useful across executors (batching, parametrization etc.) -
gool.executor.yyy: native compilation and running of the yyy output concrete language. -
gool.executor.common: the classes that must be extended to write agool.executor.yyy. -
gool.executor: useful across executors (running a command etc.) -
gool.test: testing all that.