Akash's CP Compiler is a web-based compiler aimed at competitive programming. It combines three core components:
- Lexical Analysis (Lexer): Converts raw code into tokens.
- Syntactic Analysis (Parser): Builds an Abstract Syntax Tree (AST) from the tokens.
- Code Reconstruction (Reconstructor): Traverses the AST to generate optimized C++ code.
- Tokenizes input code while handling comments and errors.
- Parses code to validate syntax and detect custom functions.
- Generates contest-ready, optimized C++ code.
- Provides a user-friendly web interface built with Flask and Tailwind CSS.
-
Clone the Repository
Open your terminal and run:git clone https://github.com/Akash35721/version5
-
Navigate to the Project Folder
Change directory:cd version5 -
Install Python Dependencies
Run:pip install -r requirements.txt
-
Run the Application
Start the Flask server:python app.py
Then, open your browser and go to http://127.0.0.1:5000 to use the compiler.
The project compiles C++ source files using g++ via a PowerShell script:
lexer.cppparser.cppreconstructor.cpp
The build_and_run.ps1 script manages the build process.
.vscode/– VS Code settings and configurations.app.py– Flask web server.build_and_run.ps1– PowerShell build script.lexer.cpp,parser.cpp,reconstructor.cpp– C++ source files.templates/– HTML template for the web interface.readme.md– Project documentation.
Feel free to fork and open pull requests or issues if you find bugs or have suggestions for improvements.
This project is shared under the terms defined in the repository.
Happy Coding!