An open API service indexing awesome lists of open source software.

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.

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