{"id":25477626,"url":"https://github.com/notkamui/tpc-compiler","last_synced_at":"2025-08-13T19:36:31.324Z","repository":{"id":149918847,"uuid":"373915068","full_name":"notKamui/TPC-Compiler","owner":"notKamui","description":"A compiler for a very small subset of C (Très Petit C)","archived":false,"fork":false,"pushed_at":"2023-01-30T10:27:30.000Z","size":232,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-23T14:43:35.447Z","etag":null,"topics":["c","compiler","language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notKamui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-06-04T17:27:03.000Z","updated_at":"2025-02-24T15:27:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f27c3f08-66c1-4b20-b0d6-93544443de01","html_url":"https://github.com/notKamui/TPC-Compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/notKamui/TPC-Compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notKamui%2FTPC-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notKamui%2FTPC-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notKamui%2FTPC-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notKamui%2FTPC-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notKamui","download_url":"https://codeload.github.com/notKamui/TPC-Compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notKamui%2FTPC-Compiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270301261,"owners_count":24561489,"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-08-13T02:00:09.904Z","response_time":66,"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","language"],"created_at":"2025-02-18T13:51:14.766Z","updated_at":"2025-08-13T19:36:31.272Z","avatar_url":"https://github.com/notKamui.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TPC Compiler\n\n## A very small subset of C (Très Petit C)\n\nby notKamui \u0026 ZwenDo, syntax defined by the Université Gustave Eiffel\n\n### Summary\n\n-   [The Language](#The-Language)\n-   [Requirements](#Requirements)\n-   [Compiling the Compiler](#Compiling-the-Compiler)\n-   [Usage](#Usage)\n-   [Sample](#Sample)\n\n### The Language\n\nTPC, which stands for \"Très Petit C\", is an extremely small and unusable subset of C.\n\nIt only exists as a very interesting exercise on syntax analysis, finite state machines and compilation to nasm x86-64.\n\nThe grammar of the language is defined in `./src/parser.y`.\n\nIt has no data structures except for `struct`s (which are non recursive nor nested), and has no `for` loops, nor pointers.\nThe only two primitives are `int` and `char`, and the only control flow instructions are `if`, `else`, and `while`. The rest of the syntax is vastly equivalent to that of C.\n\n### Requirements\n\n-   Make sure you're on a \\*nix system (Linux, MacOS, etc)\n-   Make sure you have a recent version of `gcc` installed\n-   Make sure you have `make` installed\n\n### Compiling the Compiler\n\nJust `make` in the root of this project. The binary of the compiler will be located in `./bin/`.\n\n### Usage\n\n```\nUsage: tpcc [OPTIONS] [file]\n\nOPTIONS:\n-t: Prints the AST of the selected program\n-s: Prints the symbol table of the selected program\n-n: No output (prevents creating an asm file)\n-x: produces an executable file\n-h: Prints this message\ntpcc can also receive its input feed from stdin\n```\n\n### Sample\n\nA good sample is given in `./sample/mini_game.tpc`. It's a valid tpc program that you can compile and execute (it's a Guess The Number game).\n\nCompile and execute it with the following commands:\n\n```sh\ntpcc -nx sample/mini_game.tpc\n./mini_game\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotkamui%2Ftpc-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotkamui%2Ftpc-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotkamui%2Ftpc-compiler/lists"}