Regex processing algorithm:
- Tokenize input regular expression using Lexer (in case of Moore machine or Buchi machine - parse all regular expressions divided by a comma)
- Build the finite state machine (FSM) using FSMBuilder (or Moore machine using MooreMachineBuilder or Buchi machine using BuchiMachineBuilder)
- Build the machine with epsilon transitions (marked as $)
- Build the determined machine
- Check word acceptance using FSM.acceptance (or MooreMachine.acceptance) - unavailable for Buchi machine
python cli.py "{a|b}bba" 0 abba ba ababba baba
First argument is regular expression, second argument is target machine type (0 for FSM, 1 for Moore machine, 2 for Buchi machine), next arguments are words for acceptance testing.
python gui.py
- Python library graphviz, which is installed using
pip install graphviz
- Graphviz tool (download here). You also have to add directory with Graphviz binaries to PATH.