{"id":27154825,"url":"https://github.com/antoinebendafischulmann/my_custom_compiler","last_synced_at":"2025-10-16T09:32:29.540Z","repository":{"id":284952949,"uuid":"955612039","full_name":"AntoineBendafiSchulmann/my_custom_compiler","owner":"AntoineBendafiSchulmann","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-28T14:42:55.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T18:51:55.042Z","etag":null,"topics":["c","compiler","custom-language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntoineBendafiSchulmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-26T23:11:25.000Z","updated_at":"2025-03-28T14:42:59.000Z","dependencies_parsed_at":"2025-03-28T15:46:46.348Z","dependency_job_id":null,"html_url":"https://github.com/AntoineBendafiSchulmann/my_custom_compiler","commit_stats":null,"previous_names":["antoinebendafischulmann/my_custom_compiler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AntoineBendafiSchulmann/my_custom_compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineBendafiSchulmann%2Fmy_custom_compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineBendafiSchulmann%2Fmy_custom_compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineBendafiSchulmann%2Fmy_custom_compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineBendafiSchulmann%2Fmy_custom_compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntoineBendafiSchulmann","download_url":"https://codeload.github.com/AntoineBendafiSchulmann/my_custom_compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineBendafiSchulmann%2Fmy_custom_compiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279173295,"owners_count":26119041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","compiler","custom-language"],"created_at":"2025-04-08T18:43:50.682Z","updated_at":"2025-10-16T09:32:29.524Z","avatar_url":"https://github.com/AntoineBendafiSchulmann.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  My Custom Compiler\n\nUn compilateur écrit en C pour transformer un langage custom `.mcc` en C standard compilable avec `gcc`.\n\n```\nmy_custom_compiler/       # Code source du compilateur\n\n├── Makefile              # Script de compilation principal\n├── README.md             # Documentation\n├── .gitignore           \n\n├── mycc                  # Le binaire compilé (généré par `make`)\n\n├── src/                  # Code source du compilateur\n│   ├── main.c            # Point d'entrée : lit les arguments et lance la compilation\n│   ├── compiler.c/h      # Pipeline général : lex → parse → codegen\n│\n│   ├── lexer/            # Analyse lexicale (tokenisation)\n│   │   ├── lexer.c\n│   │   ├── lexer.h\n│\n│   ├── parser/           # Transforme les tokens en instructions\n│   │   ├── parser.c/h    # Analyse la grammaire du langage\n│   │   ├── ast.c/h       # Représente les instructions sous forme d'arbre (AST)\n│\n│   ├── codegen/          # Génération du code C\n│   │   ├── codegen.c/h\n│\n│   └── utils/            # Fonctions utilitaires (log, erreurs...)\n│       ├── utils.c/h\n\n├── examples/             # Fichiers source en langage .mcc\n│   ├── hello.mcc\n│   ├── math.mcc\n│   ├── while_loop.mcc\n│   ├── if_else.mcc\n│   ├── compare_ops.mcc\n│   └── hello_string.mcc\n        ect...\n\n├── out/                  # Fichiers générés\n│   ├── *.c               # Code C généré\n│   └── *.out             # Exécutables compilés\n```\n\n#### 🛠️ Fonctionnalités actuelles :\n\n- ✅ ```let x = 5;``` – Déclaration de variable\n- ✅ ```x = x + 1;``` – Affectation sans redéclaration\n- ✅ `let x = 5;` – Déclaration de variable\n- ✅ `x = x + 1;` – Affectation sans redéclaration\n- ✅ `let z = x + y;` – Déclaration avec expression\n- ✅ `print(x);` – Affichage de variables\n- ✅ `print(\"text\");` – Affichage de chaînes de caractères\n- ✅ `+ - * /` – Opérations arithmétiques\n- ✅ `== != \u003c \u003e \u003c= \u003e=` – Comparateurs\n- ✅ `if (...) {}` + `else {}` – Conditions\n- ✅ `while (...) {}` – Boucles\n- ✅ Analyse sémantique : erreur si variable non déclarée\n\n\n#### 🚧 TODO\n-  ```print(\"x =\", x);``` – Affichage multi-arguments\n\n-  ```fn add(a, b) { return a + b; }``` – Fonctions utilisateur\n\n- Typage explicite (ex : int, bool, string)\n\n- Portée et environnement (scope, bloc)\n\n- ```for (...)``` + ```break```, ```continue```\n\n- CLI améliorée : ```./mycc -o out.c```\n\n- Modules / import / gestion multi-fichiers .mcc\n\n\n## 🚀 Utilisation\n\n### compiler le compilateur\n```bash\nmake clean \u0026\u0026 make\n```\n\n### compiler un fichier .mcc\n```bash\n./mycc examples/hello.mcc out/hello.c\n```\n\n### compiller  le C généré  \n```bash\ngcc out/hello.c -o out/hello.out\n```\n\n### Lance le programme\n```bash\n./out/hello.out\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoinebendafischulmann%2Fmy_custom_compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantoinebendafischulmann%2Fmy_custom_compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoinebendafischulmann%2Fmy_custom_compiler/lists"}