/regex-to-nfa

A python tool for Regex conversion to nondeterministic finite automaton (NFA)

Primary LanguagePython

Regex-to-NFA Converter

A python tool for Regex conversion to nondeterministic finite automaton (NFA).

Usage

  • Install dependencies :

    pip install -r requirements.txt
  • Run tool :

    python convert.py "REGEX"

For example : python convert.py "0(1+0)|0*"

  • Output NFA and its directed graph will be exported to out/ folder.

Folder Structure

  • src folder : contains the source code of the converter :

    • build_nfa.py : code for building NFA from Regex.
    • visualize_nfa.py : code for NFA visualization.
  • out folder : contains the outputs.

  • test_cases folder : contains the results of the given test cases.

  • convert.py : main conveter driver.

  • requirements.txt : python dependencies.