Team Ai
Apppublic

itsjerry125/CppCheck-Py

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
README.md110 linesDownload Raw Back to root
1---2title: Cppcheck Py Space3emoji: 💻4colorFrom: red5colorTo: purple6sdk: docker7app_port: 85018tags:9- streamlit10pinned: false11short_description: C++-like Syntax Checker12---13 14# CppCheck-Py15 16> A Python‑based syntax checker for a defined subset of C++.17 18A web and CLI C++ syntax checker built with Python and Streamlit.19- **Live demo:** [cppcheck-py-space on Hugging Face](https://itsjerry125-cppcheck-py.hf.space)20 21## Table of Contents22 23- [CppCheck-Py](#cppcheck-py)24  - [Table of Contents](#table-of-contents)25  - [Project Overview](#project-overview)26  - [Features](#features)27  - [Folder Structure](#folder-structure)28  - [Installation](#installation)29  - [Usage](#usage)30 31---32 33## Project Overview34 35CppCheck‑Py is a streamlined syntax‑checking tool written in pure Python. It processes C++ source code within a selected language subset, identifies syntax errors, and reports them in a clear, user‑friendly manner. Designed for both command‑line and web‑based integration, CppCheck‑Py emphasizes modular, object‑oriented design.36 37---38 39## Features40 41- **OOP Lexer & Parser**  42  Implements a class‑based lexer and recursive‑descent parser to tokenize input and verify grammar rules.43 44- **Comprehensive Error Reporting**  45  Pinpoints syntax errors with line and column information, offering suggestions to correct common mistakes.46 47- **Modular Design**  48  Separates concerns into dedicated components (lexer, parser, checker, error utilities) for easy extension.49 50- **CLI Interface**  51  Quick command‑line access for file checks.52 53---54 55## Folder Structure56 57```58CppCheck-Py/59├── backend/              # Core syntax‑checking service60│   ├── main.py            61│   └── src/              # Module source code62│       ├── lexer.py63│       ├── parser.py64│       ├── checker.py65│       ├── errors.py66│       ├── schemas.py67│       └── routers/      # API route handlers 68├── frontend/             # Web UI69│   └── app.py70├── tests/                # Automated tests71│   ├── unit/72│   └── integration/73├── docs/                 # Documentation and diagrams74├── requirements.txt      # Python dependencies75├── Dockerfile            # Container definition 76└── README.md             # Project overview and usage77```78 79---80 81## Installation82 831. **Clone the repository**84   ```bash85   git clone https://github.com/D4PHOENIX/CppCheck-Py.git86   cd CppCheck-Py87   ```88 892. **Create a virtual environment**90   ```bash91   python3 -m venv venv92   source venv/bin/activate  # (Windows: venv\Scripts\activate)93   ```94 953. **Install dependencies**96   ```bash97   pip install -r requirements.txt98   ```99 100---101 102## Usage103 104- **Command‑Line Check**  105  ```bash106  python backend/main.py --file path/to/code.cpp107  ```108  Runs syntax analysis on the specified file and outputs any errors.109 110---