C to ARM Cross Compiler
The C to ARM Cross Compiler project is a comprehensive tool designed to compile C source code into ARM assembly instructions. It facilitates efficient development for embedded systems by bridging the gap between high-level C programming and low-level ARM machine code generation. This project leverages Python for backend compiler components and a modern React-based frontend for an interactive user interface.
This cross-compiler translates C code into ARM machine code, enabling developers to build applications optimized for ARM-based embedded devices. Its modular design, user-friendly interface, and comprehensive testing framework make it a robust solution for both learning and real-world applications in embedded system development.
- Supports standard C language features.
- Modular backend architecture including lexer, parser, semantic analysis, and code generation.
- Generates optimized ARM assembly code.
- Interactive frontend built with React and Tailwind CSS.
- Command-line API powered by Flask for backend communication.
- Comprehensive test suite covering lexical, syntactic, and semantic analysis.
- Sample input programs included for testing and demonstration.
- Python (compiler logic)
- Flask (backend API)
- React and TypeScript (frontend UI)
- Tailwind CSS (frontend styling)
- GCC (ARM compiler tools)
- Git & GitHub (version control)
- Virtual Environment (dependency isolation)
├── Backend/ # Python backend source code and compiler modules
│ ├── compiler.py
│ ├── modules/
│ ├── input/ # Sample C input programs
│ ├── output/ # Generated output files
│ ├── tests/ # Test cases and expected outputs
│ └── app.py # Flask app entry point
├── Frontend/ # React frontend source code
│ ├── src/
│ ├── index.html
│ └── package.json
├── .venv/ # Python virtual environment
├── README.md # Project documentation
└── ...
- Write or use existing C source files from the
Backend/input/
directory. - Use the backend compiler modules to tokenize, parse, and perform semantic analysis.
- Generate intermediate representation (IR) and convert it to ARM assembly code.
- Compile generated assembly using ARM GCC toolchain.
- Test generated binaries on ARM hardware or emulators.
git clone <https://github.com/Ayush-2404/C-to-Arm_Compiler.git>
cd project-root
- Create and activate the virtual environment:
python -m venv .venv
On Linux/Mac:
source .venv/bin/activate
On Windows (Command Prompt):
.venv\Scripts\activate
On Windows (PowerShell):
.venv\Scripts\Activate.ps1
-
- Install required dependencies:
pip install -r requirements.txt
- Run the Flask backend server:
python app.py
- Navigate to the Frontend directory:
cd Frontend
- Install frontend dependencies:
npm install
- Start the development server:
npm run dev
- Open the browser and visit
http://localhost:3000
to access the UI.
Tests are available in the Backend/tests/
directory. Run the backend test script to validate functionality:
python run_tests.py
- GNU Compiler Collection (GCC)
- React and Tailwind CSS communities
- Python open source ecosystem