|
1 | 1 | # Dotc's Overall Structure
|
2 | 2 |
|
3 |
| -The compiler code is found in package `dotty.tools`. It spans the |
| 3 | +The compiler code is found in package [dotty.tools](https://github.com/lampepfl/dotty/tree/master/src/dotty/tools). It spans the |
4 | 4 | following three sub-packages:
|
5 | 5 |
|
6 | 6 | backend Compiler backends (currently for JVM and JS)
|
7 | 7 | dotc The main compiler
|
8 | 8 | io Helper modules for file access and classpath handling.
|
9 | 9 |
|
10 |
| -The `dotc` package contains some main classes that can be run as separate |
11 |
| -programs. The most important one is class `Main`. `Main` inherits from `Driver` which |
12 |
| -contains the highest level functions for starting a compiler and processing some sources |
13 |
| -`Driver` in turn is based on two other high-level classes, `Compiler` and `Run`. |
| 10 | +The [dotc](https://github.com/lampepfl/dotty/tree/master/src/dotty/tools/dotc) |
| 11 | +package contains some main classes that can be run as separate |
| 12 | +programs. The most important one is class |
| 13 | +[Main](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/Main.scala). |
| 14 | +`Main` inherits from |
| 15 | +[Driver](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/Driver.scala) which |
| 16 | +contains the highest level functions for starting a compiler and processing some sources. |
| 17 | +`Driver` in turn is based on two other high-level classes, |
| 18 | +[Compiler](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/Compiler.scala) and |
| 19 | +[Run](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/Run.scala). |
14 | 20 |
|
15 | 21 | ## Package Structure
|
16 | 22 |
|
@@ -38,7 +44,9 @@ and their focus.
|
38 | 44 |
|
39 | 45 | `dotc` has almost no global state (the only significant bit of global state is the name table,
|
40 | 46 | which is used to hash strings into unique names). Instead, all essential bits of information that
|
41 |
| -can vary over a compiler run are collected in a [Context](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/core/Context.scala). Most methods in `dotc` take a Context value as an implicit parameter. |
| 47 | +can vary over a compiler run are collected in a |
| 48 | +[Context](https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/core/Contexts.scala). |
| 49 | +Most methods in `dotc` take a Context value as an implicit parameter. |
42 | 50 |
|
43 | 51 | Contexts give a convenient way to customize values in some part of the
|
44 | 52 | call-graph. To run, e.g. some compiler function `f` at a given
|
|
0 commit comments