Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/st3v3nmw/c-compiler
A compiler for a subset of the C programming language.
https://github.com/st3v3nmw/c-compiler
c-compiler compiler compiler-construction compiler-designs compiler-development compilers
Last synced: about 2 months ago
JSON representation
A compiler for a subset of the C programming language.
- Host: GitHub
- URL: https://github.com/st3v3nmw/c-compiler
- Owner: st3v3nmw
- License: mit
- Created: 2021-02-17T07:45:18.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-21T14:44:03.000Z (over 1 year ago)
- Last Synced: 2024-10-15T07:32:09.557Z (3 months ago)
- Topics: c-compiler, compiler, compiler-construction, compiler-designs, compiler-development, compilers
- Language: C++
- Homepage:
- Size: 500 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## C-Language Compiler Implementation
A compiler for a subset of the C programming language (written in C++).
See the grammar [here](specification.txt).
This project is an abomination LOL, especially the ICG.
### Project Status
1. - [x] Lexical Analyzer
2. - [x] Syntax Analyzer
3. - [ ] Semantic Analyzer
4. - [x] Intermediate Code Generator (SPIM, ish-done)
5. - [ ] Machine-Independent Code Optimizer
6. - [ ] Code Generator
7. - [ ] Machine-Dependent Code Optimizer### Project Requirements
1. C++17 (preferably g++)
### Setup
1. Clone the project into your computer.
2. Launch the project by running the `main.cpp` file. It would be easier to run the project using JetBrain's CLION IDE.
3. The test files are found in the `tests` folder.
- To switch from one testcase to another, you can:
1. Use the Makefile i.e. `make o f=tests/submitted.c && spim -file out.asm`
2. or, when directly running the executable, `./main tests/submitted.c && spim -file out.asm`
3. or, change the name in the test file specifier on the `main.cpp` file### Screenshots
1. Scanner output
![Scanner output](assets/scanner.png)
2. Parser output
![Parser output](assets/parser.png)