https://github.com/occisor2/myc
My shot at making a C compiler
https://github.com/occisor2/myc
c compiler programming-languages
Last synced: 2 months ago
JSON representation
My shot at making a C compiler
- Host: GitHub
- URL: https://github.com/occisor2/myc
- Owner: occisor2
- Created: 2024-04-27T19:10:09.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-09T02:14:35.000Z (about 1 year ago)
- Last Synced: 2025-01-11T03:19:21.903Z (4 months ago)
- Topics: c, compiler, programming-languages
- Language: C++
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: MyC
#+AUTHOR: Russell Smith
#+EMAIL: [email protected]
#+DESCRIPTION: This is the README for the MyC compiler
#+KEYWORDS: C, compiler, MyC, languages
#+LANGUAGE: en#+OPTIONS: H:4
#+OPTIONS: num:nil
#+OPTIONS: toc:2
#+OPTIONS: p:tThis is a project I'm using to teach myself about compilers and get a
better understanding of the C language.The short term goal of this project is to convert a very small subset
of C (only integers. no structs, etc.) to native x86 assembly.
Hopefully, I can find enough time to expand on this.* Building
CMake is used to build the project. The default presets use Ninja.
#+BEGIN_SRC shell
mkdir build && cd build
cmake .. --build --preset release
#+END_SRC* Project Status
Here are the current short term goals and which have been completed.
- [-] Parser
- [X] basic expressions
- [X] local variable declarations
- [X] compound statements
- [ ] non-int types
- [-] function signatures
- [X] basic identification
- [ ] parameters
- [ ] non-int return types
- [X] return values
- [-] AST Passes
- [X] print the AST
- [ ] create the symbol table
- [ ] type checking
- [ ] statement context checking (e.g. valid returns)
- [ ] Optimizer
- [ ] constant folding
- [ ] Code Generation