diff --git a/docs/readme.md b/docs/readme.md index 746cb76..42962d6 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -28,7 +28,7 @@ Builds an executable from `examples/hello` and runs it. - [Chat](https://matrix.to/#/#community:akyoto.dev) - [Donate](https://buy.stripe.com/4gw7vf5Jxflf83m7st) -- [Todo](/docs/todo.md) +- [Todo](todo.md) ## License diff --git a/src/readme.md b/src/readme.md index 50bd8e9..c29d252 100644 --- a/src/readme.md +++ b/src/readme.md @@ -1,16 +1,14 @@ ## Documentation -### [main.go](/main.go) +### [cli/Main.go](cli/Main.go) -Entry point. It simply calls `cli.Main` which we can use for testing. - -### [src/cli/Main.go](/src/cli/Main.go) +Entry point. The command line interface expects a command like `build` as the first argument. -Commands are implemented as functions in the [src/cli](src/cli) directory. +Commands are implemented as functions in the [cli](cli) directory. Each command has its own set of parameters. -### [src/cli/Build.go](/src/cli/Build.go) +### [cli/Build.go](cli/Build.go) The build command creates a new `Build` instance with the given directory and calls the `Run` method. @@ -37,7 +35,7 @@ Adding the `-v` or `--verbose` flag shows verbose compiler information: q build examples/hello -v ``` -### [src/build/Build.go](/src/build/Build.go) +### [build/Build.go](build/Build.go) The `Build` type defines all the information needed to start building an executable file. The name of the executable will be equal to the name of the build directory. @@ -57,16 +55,16 @@ Each function will then be translated to generic assembler instructions. All the functions that are required to run the program will be added to the final assembler. The final assembler resolves label addresses, optimizes the performance and generates the specific x86-64 machine code from the generic instruction set. -### [src/core/Function.go](/src/core/Function.go) +### [core/Function.go](core/Function.go) This is the "heart" of the compiler. Each function runs `f.Compile` which organizes the source code into an abstract syntax tree that is then compiled via `f.CompileAST`. You can think of AST nodes as the individual statements in your source code. -### [src/ast/Parse.go](/src/ast/Parse.go) +### [ast/Parse.go](ast/Parse.go) This is what generates the AST from tokens. -### [src/expression/Parse.go](/src/expression/Parse.go) +### [expression/Parse.go](expression/Parse.go) This is what generates expressions from tokens. \ No newline at end of file