Giter Site home page Giter Site logo

fla's Introduction

Regular Expression to DFA Converter

This is a Python codebase for converting a regular expression (regex) into a Deterministic Finite Automaton (DFA). The program allows you to input a regular expression and a string, and it will generate the DFA, validate the string against it, and provide the result. Prerequisites

Before using the code, ensure you have the following requirements:

Python 3.x
Required libraries are installed. You can install them using pip:

pip install easygui

Usage

Clone the repository:

sh

git clone https://github.com/your-username/regex-to-dfa.git

Navigate to the project directory:

sh

cd regex-to-dfa

Run the program:

sh

python main.py

The program will prompt you to enter the regular expression and a string. Enter the details and click OK.

The program will display the regular expression, alphabet, and the generated DFA.

It will also test the provided string against the DFA and display the result.

Code Structure

main.py: The main program file that handles user input and orchestrates the conversion process.
utils.py: Contains classes for building the RegexTree, creating the DFA, and running input strings on the DFA.
regex_validation.py: Validation functions for checking the correctness of the regular expression.
preprocessing.py: Preprocessing functions for cleaning up the regular expression.
Program Flow can be viewed in program_flow.png 

Flow Control

Configuration

You can configure the regular expression and other options within the codebase. Modify the regex variable in the main.py file to set your desired regular expression.

Example

Sample input and output can be viewed in input.png and output.png respectively. Input Output

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

Acknowledgments

The Encryption and Decryption Manager was developed using the easygui library for creating the graphical user interface.

fla's People

Contributors

arnavkumar302 avatar

Watchers

 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.