This project aims to develop a C++ compiler using principles of compiler design implemented in C++ programming language.
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.
To use the C++ compiler, follow these steps:
- Clone the repository:
git clone https://github.com/kanishk-chaudhary/Kanishk_Compiler.git
- Navigate to the project directory:
cd cpp-compiler
-
Compile the source code:
-
Run the compiler with the input source code file:
./compiler input.cpp
- The compiler will generate the executable output file:
./a.out