This is the official compiler for Muchku, a custom programming language built in C. Muchku is a toy language created for learning how compilers work — from lexing to parsing, code generation, and execution.
- Lexical analysis (tokenization)
- Parsing into AST (Abstract Syntax Tree)
- Code generation into executable instructions
- Simple error reporting
- Supports basic language constructs (e.g., print, variables, arithmetic , if and for)
This project was built to understand:
- Compiler architecture
- Lexers and parsers
- AST construction
- Code interpretation/generation
C Compiler (e.g., GCC)
POSIX-compliant terminal (Linux, macOS) or Git Bash/WSL (Windows)
Ensure you have GCC installed.
cd compiler
gcc main.c lexer.c parser.c codegen.c -o muchku.exe
./muchku.exe ../main.muchku