https://github.com/yanhuijessica/finite-automata-machine
Regex -> ε-NFA -> DFA -> minDFA, lexical analysis
https://github.com/yanhuijessica/finite-automata-machine
dfa dfa-minimization finite-automata-machine mindfa nfa nfa-to-dfa-conversion nfa2dfa python regex
Last synced: 6 months ago
JSON representation
Regex -> ε-NFA -> DFA -> minDFA, lexical analysis
- Host: GitHub
- URL: https://github.com/yanhuijessica/finite-automata-machine
- Owner: YanhuiJessica
- Created: 2020-01-15T08:48:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-08T11:38:02.000Z (over 4 years ago)
- Last Synced: 2025-02-09T09:30:01.695Z (8 months ago)
- Topics: dfa, dfa-minimization, finite-automata-machine, mindfa, nfa, nfa-to-dfa-conversion, nfa2dfa, python, regex
- Language: Python
- Homepage:
- Size: 176 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Finite-Automata-Machine
### Overview
This is a python program to construct ε-NFA, DFA, and minimised DFA from a given regex. After constructing DFA, it can judge a given word whether it matches the regex.
### Requirements
- Python 3
- python-graphviz#### Install
```bash
git clone https://github.com/YanhuiJessica/Finite-Automata-Machine.git
cd Finite-Automata-Machine/
pip3 install -r requirements.txt
python3 lexical_analysis.py
```### Regex -> NFA
- `Regex2NFA.basicstruct`

- `Regex2NFA.linestruct`

- `Regex2NFA.dotstruct`

- `Regex2NFA.starstruct`
### Sample Generation
- Sample regex: `1*0(0|1)*`
- Sample-generated NFA:

- Sample-generated DFA:

- Sample-generated minDFA:
