https://github.com/devkanix/kanishk_compiler
Kanishk_Compiler: A simple C++ compiler that tokenizes, parses, and generates assembly code. Supports basic language features like `exit` statements. Built with NASM and MinGW.
https://github.com/devkanix/kanishk_compiler
compiler-design cpp
Last synced: 8 months ago
JSON representation
Kanishk_Compiler: A simple C++ compiler that tokenizes, parses, and generates assembly code. Supports basic language features like `exit` statements. Built with NASM and MinGW.
- Host: GitHub
- URL: https://github.com/devkanix/kanishk_compiler
- Owner: devKanix
- Created: 2024-09-09T09:28:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-09T09:28:04.000Z (over 1 year ago)
- Last Synced: 2025-03-12T09:43:27.814Z (about 1 year ago)
- Topics: compiler-design, cpp
- Language: C++
- Homepage:
- Size: 232 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ Compiler
This project aims to develop a C++ compiler using principles of compiler design implemented in C++ programming language.
## Overview
This compiler translates C++ source code into executable machine code. It consists of the following components:
- **Lexer:** Tokenizes the input source code.
- **Parser:** Parses the token stream to determine the syntactic structure.
- **Semantic Analyzer:** Performs semantic analysis to check for language rules and constraints.
- **Intermediate Code Generator:** Generates intermediate representation for optimization and translation.
- **Code Optimizer:** Optimizes the intermediate code for efficiency.
- **Code Generator:** Translates the optimized code into target machine code.
## Usage
To use the C++ compiler, follow these steps:
1. Clone the repository:
git clone https://github.com/kanishk-chaudhary/Kanishk_Compiler.git
2. Navigate to the project directory:
cd cpp-compiler
3. Compile the source code:
4. Run the compiler with the input source code file:
./compiler input.cpp
5. The compiler will generate the executable output file:
./a.out