An open API service indexing awesome lists of open source software.

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

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:t

This 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