LEXER is a Flask-based web application that performs lexical analysis, syntax analysis for the C++ programming language, and expression tree generation. It helps programmers analyze and understand their C++ code by generating tokens, validating syntax, and visualizing the structure of the code through an expression tree.
You can try out LEXER by visiting the live demo at https://lexer-87uy.onrender.com/.
- Lexical analysis: Generates tokens from C++ code.
- Syntax analysis: Checks if the code follows the correct syntax.
- Expression tree generation: Creates an expression tree to visualize the code structure.
- User-friendly interface: A simple and intuitive web interface for interacting with the compiler.
To run LEXER locally, follow these steps:
- Clone the GitHub repository:
git clone https://github.com/sallar-ba/Lexer.git
- Navigate to the project directory:
cd Lexer
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
-
For Windows:
venv\Scripts\activate
-
For Unix or Linux:
source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Start the Flask development server:
flask run
- Access LEXER by visiting http://localhost:5000 in your web browser.
-
Open LEXER in your web browser.
-
Paste your C++ code into the provided text area.
-
Click the "Analyze" button to perform lexical and syntax analysis.
-
View the generated tokens and the syntax analysis result in the respective sections.
-
Click the "Generate Tree" button to create an expression tree based on the analyzed code.
-
Explore the expression tree visualization to understand the code structure.
-
Repeat the process with different C++ code snippets as needed.
Contributions are welcome! If you find a bug or want to suggest an enhancement, please open an issue on the GitHub repository. You can also fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License .