{"id":20163944,"url":"https://github.com/raihan4520/compiler-design","last_synced_at":"2026-05-15T05:03:09.287Z","repository":{"id":259800562,"uuid":"864307942","full_name":"Raihan4520/Compiler-Design","owner":"Raihan4520","description":"C and C++ projects from the Compiler Design course at AIUB, covering lexical analysis, syntax analysis, and code generation phases.","archived":false,"fork":false,"pushed_at":"2024-09-30T11:24:17.000Z","size":23497,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T03:13:08.944Z","etag":null,"topics":["c","compiler-design","cpp","intermediate-code-generation","lexical-analysis","syntax-analysis"],"latest_commit_sha":null,"homepage":"https://www.aiub.edu/faculties/fst/ug-course-catalog","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/Raihan4520.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":"2024-09-27T22:48:40.000Z","updated_at":"2024-12-17T07:58:00.000Z","dependencies_parsed_at":"2024-10-28T04:09:54.513Z","dependency_job_id":null,"html_url":"https://github.com/Raihan4520/Compiler-Design","commit_stats":null,"previous_names":["raihan4520/compiler-design"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Raihan4520/Compiler-Design","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raihan4520%2FCompiler-Design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raihan4520%2FCompiler-Design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raihan4520%2FCompiler-Design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raihan4520%2FCompiler-Design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raihan4520","download_url":"https://codeload.github.com/Raihan4520/Compiler-Design/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raihan4520%2FCompiler-Design/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33054454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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-design","cpp","intermediate-code-generation","lexical-analysis","syntax-analysis"],"created_at":"2024-11-14T00:32:36.892Z","updated_at":"2026-05-15T05:03:09.252Z","avatar_url":"https://github.com/Raihan4520.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compiler Design Course (C and C++)\n\nThis repository contains C and C++ code implementations and exercises from the **Compiler Design** course at **American International University - Bangladesh (AIUB)**. The repository showcases key concepts related to compiler construction, focusing on the various phases of compilation, including lexical analysis, syntax analysis, and intermediate code generation.\n\n### Course Information\nFor more details on the course, refer to the [AIUB Undergraduate Course Catalog](https://www.aiub.edu/faculties/fst/ug-course-catalog).  \n*Note: Search for \"Compiler Design\" for specific course information.*\n\n## Table of Contents\n- [Overview](#overview)\n- [Course Topics Covered](#course-topics-covered)\n- [Technologies Used](#technologies-used)\n- [How to Run](#how-to-run)\n- [Contact](#contact)\n\n## Overview\n\nThe codes in this repository represent the practical applications of compiler design principles. Each section corresponds to different components of a compiler, such as tokenization, parsing, and generating intermediate code, all implemented in **C++**.\n\nThese exercises were designed to deepen the understanding of how compilers work by implementing various algorithms and techniques used in real-world compilers.\n\n## Course Topics Covered\n\n1. **Lexical Analysis**  \n   - **Description:** Implementation of a lexical analyzer that breaks down input into tokens such as identifiers, keywords, operators, and literals.\n   - **Key Concepts:** \n     - Tokenization using regular expressions.\n     - Generation of a token stream from source code.\n\n2. **Syntax Analysis**  \n   - **Description:** Creation of parsers that analyze the syntactic structure of code based on context-free grammars (CFG).\n   - **Key Concepts:**\n     - Construction of parse trees.\n     - LL(1) and recursive descent parsing.\n     - Detecting and handling syntax errors.\n\n3. **Semantic Analysis**  \n   - **Description:** Basic semantic checking, including type checking and ensuring variables are declared before use.\n   - **Key Concepts:**\n     - Scope management and symbol tables.\n     - Checking for semantic errors, such as type mismatches.\n\n4. **Intermediate Code Generation**  \n   - **Description:** Code that translates high-level language constructs into intermediate representations (like three-address code).\n   - **Key Concepts:**\n     - Three-address code (TAC) generation.\n     - Abstract syntax trees (AST) used for code generation.\n    \n## Technologies Used\n\n- **Programming Languages:**\n  - **C**\n  - **C++**\n    \n- **Tools and Libraries:**\n  - Standard C/C++ libraries\n  - Manual implementation of lexer, parser, and code generation without external tools like Flex or Bison.\n\n## How to Run\n\n\n### Running C Code\nTo compile and run C files, follow these steps:\n\n1. Clone the repository to your local machine:\n   ```bash\n   git clone https://github.com/Raihan4520/Compiler-Design.git\n2. Navigate to the folder containing the specific C file you want to run.\n3. Compile the C code using a C compiler such as gcc:\n   ```bash\n   gcc \u003cfilename\u003e.c -o \u003coutput_name\u003e\n4. Run the compiled executable:\n   ```bash\n   ./\u003coutput_name\u003e\n\n### Example\nTo compile and run an example code in C:\n```bash\ngcc example_code.c -o example_code\n./example_code\n```\n\n### Running C++ Code\nTo compile and run C++ files, follow these steps:\n\n1. After cloning the repository, navigate to the folder containing the C++ file.\n2. Compile the C++ code using a C++ compiler like g++:\n   ```bash\n   g++ \u003cfilename\u003e.cpp -o \u003coutput_name\u003e\n3. Run the compiled executable:\n   ```bash\n   ./\u003coutput_name\u003e\n\n### Example\nTo compile and run an example code in C++:\n```bash\ng++ example_code.cpp -o example_code\n./example_code\n```\n\nEach file in the repository is standalone, and comments are included in the code to guide you on the expected input and output for each program.\n\n## Contact\n\nIf you have any questions or suggestions, feel free to reach out through the repository's issues or contact me directly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraihan4520%2Fcompiler-design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraihan4520%2Fcompiler-design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraihan4520%2Fcompiler-design/lists"}