|
1 | 1 | ## File Structure |
2 | 2 | - `drasil-gool` exposes two modules: `GOOL.hs` and `GProc.hs`. `GOOL.hs` exports everything that is strictly OO as well as everything that is common between OO and procedural. Likewise, `GProc.hs` exports everything that is strictly procedural as well as everything that is common between OO and procedural. |
3 | | -- `Drasil/GOOl` currently contains everything GOOL/GProc related. This may change as our restructuring continues, but is the current way things are. |
| 3 | +- `drasil-gool/lib/Drasil` is split into three folders to reflect its contents: |
| 4 | + - `/Shared/` contains the "imperative core" shared by GOOL and GProc. |
| 5 | + - `/GOOL` contains the OO-only code used exclusively by GOOL. |
| 6 | + - `/GProc/` contains the procedural-only code used exclusively by GProc. |
| 7 | +- Because each of the above folders contains the same types of files, it is esiest to talk about them together: |
4 | 8 | - `InterfaceCommon.hs`, `InterfaceGOOL.hs`, and `InterfaceProc.hs` define the main external interface, essentially the 'syntax' of GOOL/GProc. This consists of a bunch of typeclasses as well as some smart constructors. The typeclasses for each file are wrapped up in the `SharedProg`, `OOProg`, and `ProcProg` typeclasses, respectively. |
5 | 9 | - `RendererClassesCommon.hs`, `RendererClassesOO.hs`, and `RendererClassesProc.hs` define an internal interface for rendering `Doc`s. The typeclasses of each file are wrapped up in `CommonRenderSym`, `OORenderSym`, and `ProcRenderSym`, respectively. |
6 | 10 | - `CodeInfoOO.hs` and `CodeInfoProc.hs` are preprocessors which give the actual language renderers some extra information. They implement `OOProg` and `ProcProg` respectively, but not `OORenderSym` or `ProcRenderSym`. |
|
10 | 14 | - `AST.hs` defines what information is kept about various GOOL/GProc constructs. Examples include the type of a value and the name of a variable. This is helpful for when you are given a value and need to know something about it. |
11 | 15 | - `State.hs` gives the `GOOLState`, which keeps track of everything that needs to be kept track of in GOOL/GProc. For example. the AST needs to be kept in the `GOOLState` so that we can get information back out of GOOL/GProc constructs later. |
12 | 16 | - There are a few others that you might come across, but these are the main ones. |
13 | | -- `Drasil/GOOL/LanguageRenderer` contains the language renderers, as well as modules containing function implementations that are common between multiple renderers. |
14 | | - - `LanguagePolymorphic.hs` contains function implementations that are shared between all renderers. |
15 | | - - `CLike.hs` contains function implementations for features that follow the 'classic C-like' structure. |
16 | | - - `CommonPseudoOO.hs` contains function implementations where not all languages use that implementation, but there's no other pattern between them. |
17 | | - - `AbstractProc.hs` contains function implementations that are only used by procedural languages. |
18 | | - - `Macros.hs` gives implementations for functions that are just syntactic sugar - e.g. in Java, C#, and C++, a `listSlice` translates to a `for`-loop. |
19 | | - - `Constructors.hs` gives more technical helper functions that have to do with creating values. |
| 17 | + - `Drasil/GOOL/LanguageRenderer` contains the language renderers, as well as modules containing function implementations that are common between multiple renderers. |
| 18 | + - `LanguagePolymorphic.hs` contains function implementations that are shared between all renderers. |
| 19 | + - `CLike.hs` contains function implementations for features that follow the 'classic C-like' structure. |
| 20 | + - `CommonPseudoOO.hs` contains function implementations where not all languages use that implementation, but there's no other pattern between them. |
| 21 | + - `AbstractProc.hs` contains function implementations that are only used by procedural languages. |
| 22 | + - `Macros.hs` gives implementations for functions that are just syntactic sugar - e.g. in Java, C#, and C++, a `listSlice` translates to a `for`-loop. |
| 23 | + - `Constructors.hs` gives more technical helper functions that have to do with creating values. |
0 commit comments