https://github.com/igor-240340/compilerc
Custom ridiculous C compiler for education and fun
https://github.com/igor-240340/compilerc
Last synced: 4 months ago
JSON representation
Custom ridiculous C compiler for education and fun
- Host: GitHub
- URL: https://github.com/igor-240340/compilerc
- Owner: igor-240340
- Created: 2025-04-20T13:45:16.000Z (6 months ago)
- Default Branch: dev
- Last Pushed: 2025-05-04T22:50:37.000Z (5 months ago)
- Last Synced: 2025-05-17T12:15:19.055Z (5 months ago)
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Compiler C
Very stupid custom C compiler for fun written in C++.
There are no plans to write a fully functional C compiler.
This project is solely for developing a deeper understanding of how everyday high-level programming works under the hood.## How it works
For now can compile just a simple main function with 3 int variables and one arithmetic operation.1. Tokenizes source code with regexps.
2. Top-down parser builds an AST.
3. Code generator moves through an AST and generates assembly code compatible with MASM.To build exe from output assembly file run `x64 Native Tools Command Prompt` (it should be available if you've installed MSVC) and start `build.bat`.