https://github.com/dplassgit/adventofcompilers
My implementation of the C compiler from Nora Sandler's book "Writing a C Compiler"
https://github.com/dplassgit/adventofcompilers
compiler compiler-construction compilers writing-a-c-compiler
Last synced: 12 months ago
JSON representation
My implementation of the C compiler from Nora Sandler's book "Writing a C Compiler"
- Host: GitHub
- URL: https://github.com/dplassgit/adventofcompilers
- Owner: dplassgit
- License: mit
- Created: 2024-12-02T01:59:30.000Z (over 1 year ago)
- Default Branch: trunk
- Last Pushed: 2025-04-05T23:40:35.000Z (12 months ago)
- Last Synced: 2025-04-06T00:23:21.745Z (12 months ago)
- Topics: compiler, compiler-construction, compilers, writing-a-c-compiler
- Language: Java
- Homepage:
- Size: 3.09 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Compilers
In which I write the compiler from "Writing a C Compiler" by Nora Sandler.
## Running
From this directory:
```
./scripts/mycc example/main.c
```
Requires classfiles to be in the `bin` directory
## Testing
From the `writing-a-c-compiler-tests` repo directory:
```
./test_compiler ../adventofcompilers/scripts/mycc --chapter 1
```
or
```
./test_compiler ../adventofcompilers/scripts/mycc --chapter 3 --stage lex
```
## Notes to self
Update `TackyCodeGen` for `--stage tacky` updates.
Update `TackyInstructionToInstructionsVisitor` for `--stage codegen` updates.
Update `TackyToAsmCodeGen` for "Assembly Generation" updates.