This project was implemented as our Compilers' course project. It essentially implements the full compiler pipeline : Front-End | IR | Back-End
- "We used C to make C", this project was entirely written in C. Such speed, less space.
- Uses Flex and Bison's implementation for Lex and Yacc.
- Friendly Syntax
- Not Strictly typed
- Predictive and informative error handling
- Produces stack machine assembly. Aiming for compatibility with different CPU architectures.
- Cauce -pronounced as "Sauce"- is our minimalistic GUI using TKinter.
- Supports advanced programming schemes like Recursions, Nest-oriented programming, structs, Polymorphism, etc.
- Debugger [Future plans]
you can find our Language rules here: https://docs.google.com/document/d/1AywCNfDTK4mzxmF-IoVwgKzLli8sE6zEiFXHfqb00Ug/edit?usp=sharing
Watch our demo ! 💫
GUI.mp4
CTRL + N
New fileCTRL + O
Open fileCTRL + S
Save fileCTRL + Shift + S
Save file as
- Open CMD in the GUI directory, type
python ctk.py
- Write your Code inside
- Hit Compile!
flex lexer.l
bison -d parser.y
cc *.c -o out.exe
- write your Code inside a file, for example myCode.txt
.\out.exe myCode.txt
stackassembly.txt
our assembly stack machine programsymboltable.txt
the final symbol table after complete compilationsymboltablelogs.txt
log file containing the symbol table step by step (very useful for debugging)ParsingErrors.txt
containing all indeces of lines with Syntax errorsSemanticErrors.txt
contains all indeces of lines if any semantic warning gets raised
- GCC or G++ or CC
- GNU's Flex or Lex
- GNU's Bison or Yacc
- Python >= 3.8
- TKinter and Custom TKinter
pip install tkinter customtkinter
you can find our guide on how to install lex and bison on windows and linux from here: https://docs.google.com/document/d/1MAyArnxpMbBoU88uCNGYJ-3RBwjH-wLrotDa0c85Uew/edit?usp=sharing
then just clone the repo and use it as mentioned above :)
- Cudo | Crust's friendly debugger
- Better UI Features
- Linking multiple code files, Imports and externs
- An actual VM instead of using an external assembler to execute our stack-machine code
"Appreciation has the amazing habit of bringing more reasons to be grateful for."
Ayman Reda |
Marim Naser |
Mariem Muhammed |
Abeer Hussein |
⣿⣿⣿⣿⣿⣿⠿⢋⣥⣴⣶⣶⣶⣬⣙⠻⠟⣋⣭⣭⣭⣭⡙⠻⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡿⢋⣴⣿⣿⠿⢟⣛⣛⣛⠿⢷⡹⣿⣿⣿⣿⣿⣿⣆⠹⣿⣿⣿⣿
⣿⣿⣿⡿⢁⣾⣿⣿⣴⣿⣿⣿⣿⠿⠿⠷⠥⠱⣶⣶⣶⣶⡶⠮⠤⣌⡙⢿⣿
⣿⡿⢛⡁⣾⣿⣿⣿⡿⢟⡫⢕⣪⡭⠥⢭⣭⣉⡂⣉⡒⣤⡭⡉⠩⣥⣰⠂⠹
⡟⢠⣿⣱⣿⣿⣿⣏⣛⢲⣾⣿⠃⠄⠐⠈⣿⣿⣿⣿⣿⣿⠄⠁⠃⢸⣿⣿⡧
⢠⣿⣿⣿⣿⣿⣿⣿⣿⣇⣊⠙⠳⠤⠤⠾⣟⠛⠍⣹⣛⣛⣢⣀⣠⣛⡯⢉⣰
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡶⠶⢒⣠⣼⣿⣿⣛⠻⠛⢛⣛⠉⣴⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡿⢛⡛⢿⣿⣿⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡈⢿⣿
⣿⣿⣿⣿⣿⣿⣿⠸⣿⡻⢷⣍⣛⠻⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢇⡘⣿
⣿⣿⣿⣿⣿⣿⣿⣷⣝⠻⠶⣬⣍⣛⣛⠓⠶⠶⠶⠤⠬⠭⠤⠶⠶⠞⠛⣡⣿
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣬⣭⣍⣙⣛⣛⣛⠛⠛⠛⠿⠿⠿⠛⣠⣿⣿
⣦⣈⠉⢛⠻⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⣁⣴⣾⣿⣿⣿⣿
⣿⣿⣿⣶⣮⣭⣁⣒⣒⣒⠂⠠⠬⠭⠭⠭⢀⣀⣠⣄⡘⠿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡈⢿⣿⣿⣿⣿⣿