Git Product home page Git Product logo

lexer's Introduction

LEXER - C++ Compiler

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.

Demo

You can try out LEXER by visiting the live demo at https://lexer-87uy.onrender.com/.

Features

  • 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.

Installation (For Devs)

To run LEXER locally, follow these steps:

  1. Clone the GitHub repository:
  git clone https://github.com/sallar-ba/Lexer.git
  1. Navigate to the project directory:
  cd Lexer
  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
  • For Windows:

    venv\Scripts\activate
  • For Unix or Linux:

    source venv/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Start the Flask development server:
flask run
  1. Access LEXER by visiting http://localhost:5000 in your web browser.

Usage

  1. Open LEXER in your web browser.

  2. Paste your C++ code into the provided text area.

  3. Click the "Analyze" button to perform lexical and syntax analysis.

  4. View the generated tokens and the syntax analysis result in the respective sections.

  5. Click the "Generate Tree" button to create an expression tree based on the analyzed code.

  6. Explore the expression tree visualization to understand the code structure.

  7. Repeat the process with different C++ code snippets as needed.

Authors

Contributing

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.

License

This project is licensed under the MIT License .

lexer's People

Contributors

sallar-ba avatar huzaifailyas02 avatar ali39121 avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.