Skip to content

subuhana2303/IRFusion_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRFusion - Intermediate Language Compiler

🚀 Overview

IRFusion is a signature-level educational compiler prototype that compiles a simple high-level pseudo language to clean, readable C code through an intermediate representation (IR).

🔧 Features

  • Custom lexer and parser (recursive descent)
  • AST and SSA-style Intermediate Representation
  • Clean C backend code generation
  • Modular design with professional structure
  • Unit-tested and extensible

📂 Structure

IRFusion_Project/
├── main.py
├── frontend/
│   └── parser.py
├── ir/
│   └── ir_generator.py
├── backend/
│   └── codegen.py
├── samples/
│   └── example_input.irl
├── output/
├── README.md

📝 Example Input (.irl)

let a = 5;
let b = 10;
let c = a + b * 2;
print(c);

✅ Output (C)

#include <stdio.h>
int main() {
    int a = 5;
    int b = 10;
    int c = a + b * 2;
    printf("%d\n", c);
    return 0;
}

💻 Run it

python3 main.py

📜 License

MIT License

About

IRFusion is a Python-based compiler that converts simple pseudo-code into clean C code using an intermediate representation. It showcases parsing, IR generation, and backend code generation in a modular, professional design.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages