{"id":22344875,"url":"https://github.com/ibfleming/c-minus-compiler","last_synced_at":"2025-03-26T10:13:45.535Z","repository":{"id":231397900,"uuid":"781696406","full_name":"ibfleming/c-minus-compiler","owner":"ibfleming","description":"My own language compiler made in C/C++ for my CS445 Compiler course at University of Idaho in Spring 2023. The name of the language compiler is 'C-'.","archived":false,"fork":false,"pushed_at":"2024-10-23T20:34:15.000Z","size":15220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"final","last_synced_at":"2025-01-31T11:33:45.974Z","etag":null,"topics":["compiler","compiler-design"],"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/ibfleming.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":"2024-04-03T21:39:21.000Z","updated_at":"2024-10-09T20:16:52.000Z","dependencies_parsed_at":"2024-10-23T23:46:22.138Z","dependency_job_id":null,"html_url":"https://github.com/ibfleming/c-minus-compiler","commit_stats":null,"previous_names":["ibfleming/my-compiler","ibfleming/c-minus-compiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibfleming%2Fc-minus-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibfleming%2Fc-minus-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibfleming%2Fc-minus-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibfleming%2Fc-minus-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibfleming","download_url":"https://codeload.github.com/ibfleming/c-minus-compiler/tar.gz/refs/heads/final","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245632418,"owners_count":20647194,"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","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":["compiler","compiler-design"],"created_at":"2024-12-04T09:15:22.802Z","updated_at":"2025-03-26T10:13:45.510Z","avatar_url":"https://github.com/ibfleming.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C- Language Compiler by Ian Fleming\n\nHere you will find the codebase for my language compiler made from scratch. The custom language this compiler was made for is called \"C-\". \nYou can find the grammar and other information on the syntax and behavior of this language in the C- Grammar PDF in the 'final' branch.\nThis repository contains various implementations of programming concepts, principles, and techniques related to compiler design and development. \nThis was assigned as a class project for my CS445 Compiler course at the University of Idaho in Spring 2023.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Example](#example)\n- [License](#license)\n\n## Features\nThis compiler project encompasses a wide range of features and techniques, including:\n\n- Abstract Syntax Trees (AST)\n- Lexical Analysis (Tokenization)\n- Parsing (Syntax Analysis)\n- Semantic Analysis\n- Data Structures\n- Breadth-First Search (BFS)\n- Depth-First Search (DFS)\n- Code Generation\n\n## Installation\n\nThis project requires you to have ``a native gcc/g++ compiler, make, bison, and flex`` installed and working properly in your native environment.\n\n1. Clone the repostiory\n\n    ``git clone https://github.com/ibfleming/my-compiler.git``\n\n## Usage\n\n1. Compile the program.\n\n    ``make clean;make``\n\n    *This first cleans the old objects/artifacts from previous compilations and then compiles.*\n\n2. Executing the program...\n\n    Inside the **test** folder of the repository contains C- files that we can use to compile.\n    You can execute the program as follows:\n   \n   ``./c- \u003cc- file path\u003e`` *(An input file is required!)*\n\n    #### Arguments (Pass these into the execution of the program, example below...):\n   \n    - **M** - Prints the augmented tree of the code.\n    - **p** - Prints the regular tree of the code.\n    - **P** - Prints the annotated tree of the code.\n    - **d** - Enables yydebug (YACC debug print-outs).\n    - **#** - My custom debug for various random things.\n    \n   *Ex:* To print the annotated and augmented trees you would execute the following...\n   \n   ``./c- -P -M \u003cc- file path\u003e`` *(The input file must be the last argument!)*\n\n3. A ``.tm`` file will be generated after the execution of the program.\n\n    *This file contains information of the Turing Machine code produced by the passed C- file.*\n\n4. Enjoy the program! You can find a series of program examples in the ``examples`` folder.\n\n    *You can view the language and grammar of C- in each ``.c-`` file. Furthermore, each program has an expected output and ``.tm`` code file.*\n\n## Example\n\nExecuting the ``a2a.c-`` program...\n\n#### Augmented Tree Output:\n\n![Augmented Tree](https://github.com/ibfleming/my-compiler/blob/final/img/example-augtree.png)\n\n#### Regular Tree Output:\n\n![Regular Tree](https://github.com/ibfleming/my-compiler/blob/final/img/example-regtree.png)\n\n#### Annotated Tree Output:\n\n![Annotated Tree](https://github.com/ibfleming/my-compiler/blob/final/img/example-annotree.png)\n\n#### YYDEBUG Output:\n\n![YYDEBUG](https://github.com/ibfleming/my-compiler/blob/final/img/example-yydebug.png)\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE). See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibfleming%2Fc-minus-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibfleming%2Fc-minus-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibfleming%2Fc-minus-compiler/lists"}