Skip to content

devKanix/Kanishk_Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Navigate to the project directory:

cd cpp-compiler

  1. Compile the source code:

  2. Run the compiler with the input source code file:

./compiler input.cpp

  1. The compiler will generate the executable output file:

./a.out

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors